A Tour of the Motion Editor

The Motion Editor is like a powerful microscope that lets you examine a motion tween's innards. Combining the features of the timeline and the Properties panel, the Motion Editor focuses on a single tween span, showing you its workings at a seemingly molecular level. Not only that, but the Motion Editor also gives you the power to make a change to any tweenable property at any point in time. With all this firepower, you can create very complex tweens and control them with better precision than ever before.

To open the Motion Editor, go to Window→Motion Editor. The Motion Editor won't show its stuff unless you select either a tweened object on the stage or a tween span in the timeline. (If you want to experiment with an existing tween, you can download 08-4_Motion_Editor.fla from the Missing CD page at www.missingmanuals.com/cds.) At first glance, the Motion Editor may look a little intimidating, with lots of properties, numbers, widgets, and graph lines. Don't be put off—it's not tough to master these elements and bend those motion tweens to your iron will. If you've used Flash's custom easing feature before (it's been around since Flash 8), you have a head start.

Tip

Using the Essentials workspace, which this book uses throughout, the Motion Editor appears as a tab below the stage, next to the timeline (Figure 8-12). If you have room, though, you may want to drag the tab to a new location—like a second monitor. Giving the Motion Editor more room makes your work easier and faster.

At first, the Motion Editor may seem more like a tool for math geeks than one for graphic artists. Give it a chance, though. Master a couple of Motion Editor principles, and you'll enjoy the control and precision it provides.

Figure 8-12. At first, the Motion Editor may seem more like a tool for math geeks than one for graphic artists. Give it a chance, though. Master a couple of Motion Editor principles, and you'll enjoy the control and precision it provides.

There's a lot going on with the Motion Editor, so it's best to introduce yourself a section at a time. At the very top, there are labels for each of its sections:

You won't see anything at all in the Motion Editor unless you select a tween span in the timeline or a tweened object on the stage. Most of the time, you want to set up the basic framework of your tween in the main timeline before you work with the Motion Editor. That way, you can establish the timing for the major events in the tween, using some of the steps described on Editing a Tween Span. Using a famous cartoon example, you might have the roadrunner run off a cliff at Frame 6; then up to Frame 12 the Coyote hangs in midair, feet churning; from Frame 12 to Frame 18, the Coyote drops to the desert floor, and so on. After you have the basic timing for these major positions worked out, you can turn to the Motion Editor to perfect the details. The Motion Editor breaks down all the tweenable properties into five categories:

Within each of those categories you can do the following:

In the Motion Editor, every property has its own graph line, as shown in Figure 8-13. Move from left to right along that graph line, and you're marking the passage of time. Like the main timeline, it's measured in frames on a scale at the top of the Motion Editor. The vertical axis of the graph tracks changes in value for that particular property. The units used differ according to the property. For example, if it's the Y coordinate in the "Basic motion" panel, the value relates to the vertical position of an object on the stage, and it's measured in pixels. If it's the alpha value in the Color Effect group, it's a percentage indicating the transparency (0%) or opacity (100%) of an object.

You apply tweens to values by placing property keyframes along the timeline; Flash calculates the changes for all the values between two property keyframes (Figure 8-13). To add a property keyframe, move the playhead to the frame where you want to record a change in value, and then click the diamond-shaped button under Keyframe. This button is a toggle: If there aren't any keyframes at that position, Flash creates one. If there's a keyframe at that position, Flash removes it.

There are other ways to add property keyframes to a graph line. One of the quickest is simply to right-click at a point in the graph line and then choose Add Keyframe from the shortcut menu. Another way to add keyframes is to drag the playhead to a specific frame, and then make a change in a property's value. Flash automatically creates the property keyframe.

The Motion Editor uses a solid line in the graph to indicate values in between keyframes—values that are changing. A dashed line indicates that the values of the property aren't changing—static, in Flash-speak.

When you work with tweens, timing is everything. Whether you're controlling the movement of a jumping cheetah or changing the color of a building as it explodes, you control the timing by moving property keyframes up and down the timeline. You reposition property keyframes in the Motion Editor's graph by dragging them with the Selection or Subselection tools. By moving the property keyframe up and down, you increase or decrease the value of that property. If you drag a property keyframe left or right along the graph's timeline, you change the frame (time) at which the property change happens.

There's another way you can move property keyframes up and down the timeline—with roving keyframes. Using this method, Flash keeps track of the relationship of keyframes even as you make changes to the timeline. See the box on The Keyframe Rovers for the details.

In the Motion Editor, the basic motion properties X, Y, and Z go everywhere hand in hand. Whenever you change one of the properties, the Motion Editor registers the values for the other two. It's Flash's way of keeping tweened objects pinned down in time and space. The basic motion properties are also the only properties that you can't fine-tune using Bezier line tools.

For any properties other than the basic motion properties, you can use Bezier controls in the Motion Editor graph to create smooth changes that increase or decrease over time. It's just like editing a line that you draw on the stage. The property keyframes can be either sharp-angled corner points where a value changes abruptly, or they can be gradual curves. Initially, property keyframes are corner points. Right-click a property keyframe to change a corner point to a curve, as shown in Figure 8-14. If there are property keyframes on both sides of the one you click, you can choose whether to add a single Bezier control handle ("Smooth left" or "Smooth right") or add two handles (Smooth point). If you right-click a property keyframe that's already a curve, you can turn it back into a corner point.

Your tween span has no color effects until you apply them (in the Properties panel or the Motion Editor). To add a color effect using the Motion Editor, position the playhead on the frame where you want to make a change, click the + button, and then choose the effect you want to add: Alpha, Brightness, Tint, or Advanced Color. Once you choose an effect, its subpanel appears under Color Effect. Click the Value setting to the right of the property name, and then type a new value.

To remove a color effect, click the – button, and then choose the name of the effect from the pop-up menu. Flash removes the property changes from the tweened object, and the effect's subpanel goes away.

Flash includes a handful of standard filters that you apply to movie clips and text fields, and when you apply filters using the Motion Editor, you can change the values of these filters over time. Want a drop shadow to change its angle as the sun moves across your animation? You can do it with the Motion Editor (Figure 8-15).

Don't be afraid to experiment with the filter effects. A single filter can create dramatically different effects, as shown in Figure 8-16.

Working with Flash, you fight a constant battle to get a good view of the stage, the timeline, and all the panels and windows. It's a balancing act where you're constantly expanding this and shrinking that. Adding the Motion Editor to the mix just makes the problem tougher. It's so packed with properties, graphs, and widgets that it requires tweaking to achieve a workspace that works for you. If you plan to do a lot of work in Flash and you don't have a two-monitor system, think seriously about upgrading to one. With two monitors, you can leave your Motion Editor open on one monitor and keep your stage and main timeline open on another. To move the Motion Editor, or remove it from a docked position, drag it by the tab with its name on it.

Initially, Flash gives you a fairly skimpy view of each property. Some of the panels are closed, depending on the kinds of changes in your tween. To open and close panels, click the triangle toggle buttons, as shown in Figure 8-17.