When Flash creates a tween, it doesn't use an artist's eye; it uses an accountant's calculator. If a cartoon roadrunner sprints across the desert, it moves exactly the same distance in each frame, even though we all know that cartoon roadrunners start slowly, build up speed, and then slow as they skid to a stop, usually with a little thwang motion at the end. It's up to you to add realistic (or, if you prefer, cartoonistic) motion to your animations, and fortunately, the Ease tools are there to help. When you apply an ease to one of the properties in your tween span, Flash recalculates how much of a change takes place in each frame. Suppose you want an object, like a moving car, to roll gradually to a stop. You can apply an ease that makes the car move farther in the first few frames, and then shorter distances in the final frames until it stops, as shown in Figure 8-20.
Figure 8-20. These two tweens are onion-skinned to show the car in several different frames. The tween on the top has no ease. The Fast ease was applied to the tween on the bottom.
Flash comes with several ease presets, as shown in the menu in Figure 8-21. Ease presets aren't limited to changing the position of an object; you can apply them individually to specific properties. For example, if you have a lamp shining a yellow light, you can make that light blink on and off by applying a Square Wave ease to the alpha value (transparency) of the light. (A square wave is binary; it's either on or off.)
There are a couple of steps for applying an ease preset. First, you need to add the ease preset to the Motion Editor's Eases panel. Then you apply the ease to one or more properties, using the drop-down menus that appear in the Ease section of each property. Here are the step-by-step details for adding the Square Wave ease to make a light blink. You can create your own lamp and light, or you can use the simple desk lamp provided in 08-6_Ease_Tween.fla found at www.missingmanuals.com/cds. In either case, make sure the light emanating from your lamp is a movie clip on its own layer, and give yourself about 48 frames for the tween span.
With the light's tween selected, open the Motion Editor (Window→Motion Editor), as shown in Figure 8-22.
The Motion Editor panel opens, with the Eases panel at the bottom.
In the Eases panel, click the + button to add a new tween, and then choose Square Wave from the shortcut menu.
When you click the + button, you see the Eases menu (Figure 8-21). After you select the Square Wave ease, a subpanel for Square Wave appears under the Eases panel (with any other eases belonging to the tween span).
In the Square Wave property subpanel, set the value to 6.
Eases have a related value, but the function of the value may be different depending on the ease. The Square Wave's value controls number of changes. In this case, it controls the number of times your lamp blinks on or off.
In the Color Effect panel, click the + button, and then choose Alpha from the pop-up menu.
An Alpha subpanel appears under the Color Effect panel.
In the Motion Editor's timeline, move the playhead to the last frame of the tween, and then set the alpha value to 0.
Without any easing, this causes the light to gradually dim from 100% to 0%.
In the Color Effect→Alpha panel, in the Ease section, choose Square Wave, as shown in Figure 8-23.
The Square Wave ease is applied to all the Color Effect properties. You can see that the Alpha property subpanel is also set to Square Wave. You can apply an ease in some of the category panels, like the Transformation category, where it applies to all the properties in that category, or you can apply it individually to each property.
Test your animation.
The light flashes from on to off and then back again. It changes six times, matching the value in the Square Wave subpanel.
After you've applied an ease to a property, the graph shows two lines, as shown in Figure 8-24. The solid line shows any property changes that were originally in that tween span. The dotted line shows the property changes after you apply the tween.
You can create your own ease presets and store them in your Flash file. Once you've created a preset, you apply it just as you would any other ease preset. Flash names your preset for you, so you'll have to remember what your 3-Custom and 5-Custom ease presets do. Flash saves the presets in your Flash file, so you can use them with any property and they'll be there the next time you open the file. However, you can't use your custom ease in other Flash documents; they're available only in the document in which you created them.
To create a custom ease, click the + button in the Eases panel, and instead of choosing one of Adobe's predesigned ease presets, choose Custom at the bottom of the menu. A custom preset appears in the panel with any other eases you may be using in your document. There's a line in the graph ready for you to edit (Figure 8-25). You use Flash's standard line and Bezier tools to change the shape of the line, and subsequently change the values of any property, once the ease is applied. Other Flash Panels explains how to edit a graph line.