Featured FLA
» Author: Nitin Tikhe
» Title: Cart
» Description: This Animation Tut is a fun and useful for kids below 15 years. Watch the Flag, Doors, Stick and Horse movements.
» More by Nitin Tikhe
Featured Site
» Posted in the Flash Kit Links section
» Title: Banana Swimwear
» Description: This is a banana swim wear interactive catalog we designed and animated in Flash
If you're like me then rotating any object by tweening is frustrating. After hitting 180 degrees the movie then runs backwards and now you have to spend time fixing it just to get it to rotate correctly. On top of all this, if your movie is running too fast or slow the adjusments to the tween can be a bit time consuming. Here is a way to rotate any movie clip with only 3 frames and one variable for speed.
Create an object. In this movie I made a box.
select the object and convert it to a Movie Clip symbol.
Name the instance. I named this one "box" for ease of use
Span the object over three frames
create a new layer
Insert three blank keyframes on this new layer
In the first blank keyframe insert this action:
r = 0;
This varible is the rotation angle. We set it to 0 (normal position)
In the second frame add these actins:
setProperty ("box", _rotation, r);
r = r + 1;
Now in the last frame add the action:
gotoAndPlay (2);
To change the speed of the rotation just change the second frame action r = r + 1; to whatever number you need ex:r = r + 5; - speeds up the rotation while r = r + .05; slows it down.
Adding some if statements and other variables will allow you to control the rotation in even more detail.