How to create a flip letter effect in Adobe Flash.
Hello, I have recently installed Adobe Flash Player in my computer. I am learning some basic steps to make flash files. I have many things to learn but for now i just want to know that how to create a flip letter effect in Adobe Flash. Can anybody help me with this ?
Create a new “actions” layer.
After you have created your letters then create a new action layer. After you have created the layer, open the action panel. You can use Tweenlite engine which is easily available on world wide web. I suggest you to download the Tweenlite engine to go further. gs directory is useful to go further. After getting to it write import command for gs directory.
import gs.*;
Create tween using Tweenlite.
In the flip function, we declare a local variable named “letter” typed as MovieClip to store which letter has processed the event.
Then we remove the MOUSE_OVER listener that we’ll re-add when the letter has finished flipping.
To make your letters rotating you have to set the rotationY property of letters. You have to use Tweenlite to create a tween. Remove 360 degrees to make a full rotation. After you finished with tween then add MOUSE_OVER listener again.
Code for adding it.
01.function flip(e:MouseEvent):void{
02. var letter:MovieClip = e.currentTarget as MovieClip;
03. letter.removeEventListener(MouseEvent.MOUSE_OVER,flip);
04. TweenLite.to(letter, 1,
05. {rotationY:letter.rotationY - 360,
06. onComplete:function() {letter.addEventListener(MouseEvent.MOUSE_OVER,flip);
07. }
08. }
09. );
10.}
Final code for flipping the letters.
Following is the final code to flip your letters.
01. import gs.*;
02.
03. for (var i:int =0; i < numChildren; i++) {
04. var mc:MovieClip = getChildAt(i) as MovieClip;
05. mc.addEventListener(MouseEvent.MOUSE_OVER,flip);
06. }
07.
08. function flip(e:MouseEvent):void{
09. var letter:MovieClip = e.currentTarget as MovieClip;
10. letter.removeEventListener(MouseEvent.MOUSE_OVER,flip);
11. TweenLite.to(letter, 1,
12. {rotationY:letter.rotationY - 360,
13. onComplete:function(){letter.addEventListener(MouseEvent.MOUSE_OVER,flip);
14. }
15. }
16. );
17. }