Continuous Flash ActionScript Rotation Animation Tutorial
This Flash ActionScript tutorial shows how to use rotation property to do a continuous rotation animation.
Flash Tutorial Content:
When using with ENTER_FRAME, it is very easy to do more complicated interesting rotation animation with the rotation property with Flash ActionScript 3. This Flash tutorial will show how to do a continuous rotation animation.
The completed Flash Movie of this tutorial is shown as above. You can play around to see how it works.
Flash ActionScript Codes:
// Add Listener to the Rotate Button
rotate_btn.addEventListener(MouseEvent.MOUSE_DOWN, rotateButtonClicked);
function rotateButtonClicked(evt:MouseEvent):void {
addEventListener(Event.ENTER_FRAME, startRotate);
}
function startRotate(evt:Event):void {
rotateSquare();
}
function rotateSquare():void {
square_mc.rotation += 10;
// Display message
output_txt.text = "Current rotation angle: " + square_mc.rotation;
}
Download Flash Source File:
Remarks:
This Flash ActionScript tutorial shows how to do continous rotation animation. Most flash rotation animations are loop animation. What if you only want a single round (i.e. 360 degree rotation only) rotation animation? The next Flash ActionScript tutorial will show you how to do a single round rotation animation.