Friday, February 29, 2008

Flash Quick Tip - Seamless Looping Tween

Have you ever wanted to make an object rotate continuously in Flash? It sounds simple enough:

1) Convert your object to a Symbol such as a Movie Clip
2) Create a second keyframe a ways out from your first one
3) Tween the two key frames
4) Set the rotation in the Frame Properties of the first keyframe to either Clockwise or Counterclockwise.


This does work and as long as the second keyframe is the last frame in the timeline, the animation will loop continuously when you play or preview your Flash movie. Of course there's one small problem: The animation pauses briefly every time it loops back to the beginning. This is because the first and last frames (the keyframes) are the exact same thing while the rest of the frames all show the object in a slightly different position.

To remedy this, all you have to do is add a couple extra step to the list above. After you've set the rotation (or any other property):

5) Right-Click on the frame just before the last keyframe and select "Insert Keyframe"
6) Right-Click the last keyframe and select "Clear Keyframe"

Now when you play or preview your Flash movie it will loop seamlessly. The one thing you need to keep in mind is that if you need to change the length of the tween (the amount of frames in between the keyframes) you will need to redo all the steps otherwise you'll again see a slight stutter.

4 comments:

affordable web design said...

great blog and thanks for the tips.

Anonymous said...

"2) Create a second keyframe a ways out from your first one"
what does a ways out mean?

armadillo44 said...

By ways out I meant that you need to make a keyframe someplace futhther down the timeline then the first keyframe. So for example if your first keyframe is in frame 1 you could put the second keyframe in frame 5 (or any frame beyond that). Hope that answers your question.

Thanks for visiting my blog. Let me know if you have have any particular topics you would like me to address.

Anonymous said...

I'm glad i have visited your site, you posted some really nice information.Thanks for the information.Hoping more posts from you.
website design