Sunday, October 22, 2006

Staggering Tweens

This article assumes you have a working knowledge of Flash.. basic tweening, working with the timeline, etc.

In traditional animation, a stagger between keys is achieved by moving forward, then backward, then forward then backward, and so on. This is used to show something under strain, like someone lifting a heavy object, or pulling a rope in a tug-of-war. It's usually done on 1's (single frames) to show a vibrating kind of movement.

I've used this lots of times throughout all my Flash movies.. the first time that comes to mind is when Bingbong sees the Faeries dancing. Another one is Bigfoot's mouth as it calls for littleFoot.

Flash 8 has the Custom Ease window which allows you to control the timing of a motion tween (it can't be used on shape tweens). First, looking at a standard motion tween, you can see how it's the same drawing going from low squashed, to high stretched. If you've never used Flash before, this is the basis of Flash as an animation program. You can "slide" objects around the stage, or scale them over time like the swf below:




Note: the above .swf is Flash 8. If you can't see it, you need to update your Flash Player

The above movie is looping, so it appears that he's pulsating.. but basically this is a tween from one scale value to another over 20 frames. So we have a gradual and even movement.

The Custom Ease window in Flash 8 can be accessed by first selecting the tween in the Timeline, and then, in the Property Inspector, click the 'Edit' button. You'll see the following:


Click thumbnail image to see full size

The line represents a linear, constant movement between the two keys. Note the frame numbers at the bottom of the graph.

This gives you excellent control over the timing of your tweens, whether it's a ball rolling to a stop, a firefly tweened along a path, or even a camera pan or zoom. Clicking anywhere on the line creates a point that has tangent handles, with which you can curve the line.

To create a staggered tween on singles, you would first add points (by clicking on the line) at every frame along the line like this:



To remove points, click a point and press the Delete key on your keyboard.

Now to stagger a tween, you need to zig-zag the progress of it. In other words, you want it to go forwards, then backwards, then forwards, then backwards, etc. Do this by dragging the points up and down, so you have something like this:



See the percentages on the left? They represent the progress of the tween, so you're going forward, back, forward, back.. on 1's (single frames).

The staggered tween above is a fairly mechanical one.. you can see it's quite consistent all the way to the end keyframe. You can vary this for effect. For example, the stagger below is very violent:



It might help to think of this like a seismic graph.. The more distance from one point to the next, the more aggressive the movement.

The next image shows a stagger that starts off violent, then gets more gentle towards the end:



You could do the opposite of this, i.e. start gentle and become more jagged towards the end keyframe. Then again, you could do something completely random, like this:



The great thing about all this, is that there's still only two keyframes in the tween! You haven't added file size to the movie, and you haven't drawn any extra poses.. So here's the same .swf you saw earlier, now with a stagger:





Note: the above .swf is Flash 8. If you can't see it, you need to update your Flash Player

This guy's really distressed now.. he's screamin his arse off!

ps. you can download the FLA of the above example here. Custom Easing is available in Flash 8 Professional only, so you won't be able to open this FLA if you're using MX 2004 or earlier.

12 Comments:

chluaid said...

oh yeah.. and I also used staggers a lot in the Weightlifter Animotd.

3:22 AM  
Max said...

Wow, I totally didn't know about that, I guess you learn something new everyday :)

Your blog is really awesome, keep it up.

4:12 AM  
TheEYE said...

Bloody brilliant Adam!
Thats what I love about ye.... no matter how long I know you you can still impress with the things you can do!

6:09 AM  
Derek said...

All I see are white rectangles...and I have the latest flash player and plugin! What's going on?

3:39 AM  
chluaid said...

do you mean the screenshot thumbnails (click on them), or the animated character? If you have the latest Flash Player and can't see the tweens, I don't know what the problem could be, sorry.

11:45 AM  
CLiNK said...

Wow, that's something I would've never found out by myself. Thank you sir :D

2:37 PM  
Anonymous said...

Hi chluaid, thank you for the lesson. But take a look in internet explorer, the end of your article is missing compared with firefox.
There must be a problem with the code.

10:56 PM  
chluaid said...

ah, good old IE huh? Can always count on it to fail :)
Thanks for letting me know! I'll get onto that

11:16 PM  
Yodajammies said...

The "ease" feature in flash 8 is also really great for animating spaceships that hover and fly around the screen. :)

12:55 AM  
Anonymous said...

you may use this code for the objects:

<object type="application/x-shockwave-flash" data="staggering-tweens_fichiers/linearTween.swf" width="100" height="200">
<param name="movie" value="staggering-tweens_fichiers/linearTween.swf" />
<param name="quality" value="high">
</object>

<object type="application/x-shockwave-flash" data="staggering-tweens_fichiers/staggeredTween.swf" width="100" height="200">
<param name="movie" value="staggering-tweens_fichiers/staggeredTween.swf" />
<param name="quality" value="high">
</object>

2:23 AM  
chluaid said...

Heya, whoever you are.. thanks so much for that :)
Fixed up now - cheers!

4:29 PM  
Anonymous said...

Thanks a lot, this is great!

-Zwickel.

1:17 AM  

Post a Comment

Links to this post:

Create a Link

<< Home