Flash ActionScript Rotation 360 Degree Animation Tutorial (2)
This Flash ActionScript animation tutorial also show how to use rotation property to do a single round rotation animation. The animation effect is the same as previous tutorial but use a more straight forward method.
Flash Tutorial Content:
This Flash ActionScript tutorial also discuss how to rotate a MovieClip for 360 degree for one time only. But this time we use a bit more straight forward method to do the same Flash 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 {
square_mc.rotation += 10;
output_txt.text = "The rotation completed 360 deg.";
// Remove Listener so that the square will stop rotation
removeEventListener(Event.ENTER_FRAME, startRotate);
// Exit the function
return;
output_txt.text = "Current rotation angle: " + square_mc.rotation;
}
Download Flash Source File:
Remarks:
This is the end of Flash ActionScript rotation animation tutorial.