Return to Kroll Web Design home page Flash tutorials

« Return

ActionScript 3

Smooth Rotation of an object

If not done correctly, the rotation of an object will not be smooth. The most common problem is that it completes a rotation, then starts the next rotation at this same position, thus displaying the starting position for two frames instead of one. Below are two techniques for rotating an object smoothly.

Download the FLA file

circle_mc.addEventListener(Event.ENTER_FRAME,rotateCircle);

function rotateCircle(myEvent:Event) 
{
	circle_mc.rotation += 14.4;	
}