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.
Jason Riegner www.innousa.com
|» Level Basic|
Rating: 8 Votes: 99
|No details available.|
|Download the files used in this tutorial.|
|Download (3 kb)|
|More help? Search our boards for quick answers!|