Just a quick tutorial to go along side my AS2 version of rotation.
Setting up:
Draw a box on the stage, Select it and press ‘F8′.
Name you’re movieclip and press ‘OK’.
![]() |
Now change the instance name to ‘myMovieClip’ and press enter.
![]() |
Now for the code:
place this code in frame 1 of you’re actions panel:
// Adding mouse event to our movieclip!
myMovieClip.addEventListener(Event.ENTER_FRAME, rotateMoveClip);
// the rotateMoveClip function
function rotateMoveClip(e:Event)
{
// e.target is the reference to the MovieClip calling the event
e.target.rotation += 0.5;
}
Test you’re movie by pressing CTRL+RETURN.
If you’ve managed to follow my bad instructions then you should get a slowly rotating shape.
like this:
Also if you wish to apply the animation to multiple MovieClips simply add the event to those MovieClips like so:
// Adding mouse event to our movieclip!
myMovieClip.addEventListener(Event.ENTER_FRAME, rotateMoveClip);
myMovieClipTwo.addEventListener(Event.ENTER_FRAME, rotateMoveClip);
// the rotateMoveClip function
function rotateMoveClip(e:Event)
{
// e.target is the reference to the MovieClip calling the event
e.target.rotation += 0.5;
}
Because we use ‘e.target’ you can add as many movieclips as you like






