Understanding the Timeline
The timeline is where the bulk of the animation process takes place. This is where you control the speed at which a movie element moves, when it enters and exits the scene, and its depth, or stacking order, in relation to other elements in the scene (Figure 10.3). Most of what you'll learn in this chapter will also apply to animating symbols' timelines (especially graphic and movie clip symbols).
Figure 10.3 The various parts of the timeline.
If the timeline is consuming too much screen space, click its name to collapse it as you would any other panel.
Although we discussed layers in detail in Chapter 9, you'll probably find it helpful to review a couple of points hereespecially those that have to do with the relationship between layers, frames, and the stage.
A single frame on the timeline can have multiple layers, whose combined content you can view on the stage (Figure 10.4). (For more information about how content on various layers represents the composite animation on the stage, see "Putting It All Together" later in this chapter.) This means you can split the various animated elements of each frame's content into individual layers. Just remember that a single frame can comprise hundreds of layers. Layers are useful for creating complex animations in which a number of movie elements are used simultaneously but in different ways.
Figure 10.4 The graphical content of all visible layers is displayed on the stage.
The playhead is to the timeline what the Arrow tool is to the stage. It allows you to identify the frame being edited, select a frame to work on, and scrub the moviethat is, watch it play by dragging the playhead. The red vertical line of the playhead stretches across multiple layers to help you identify all of a frame's content.
To move the playhead to a particular frame:
Click a frame on any available layer, or select a frame on the timeline ruler.
The playhead will jump to the frame you selected.
To scrub the playhead:
Click and drag the playhead left or right.
As you move the playhead, your movie will play forward or backward, depending on which direction you drag the playhead.
To perform either of these actions, your timeline must include at least one blank frame. The white and gray rectangular boxes that appear initially on the timeline are placeholder frames. With the exception of the first frame, you must add frames manually to the timeline. For more on this, see "Inserting Frames" later in this chapter.
The timeline ruler provides a sequential display of frames along the timeline. Frame increments are marked in two ways: frame ticks, which are small vertical lines on the ruler, and frame numbers, which are displayed for every fifth frame. Normally, frame numbers are centered between the two ticks that define the frame. Three-digit frame numbers are left-aligned to the frame they represent.
Timeline Status Bar
The status bar of the timeline provides the following information (Figure 10.5):
Current frame. Indicates the frame number whose contents are currently visible on the stage. Also indicates the current position of the playhead.
Frame rate. When your movie is not playing, this box displays the current frames-per-second (fps) setting for your movie. When your movie is playing in the authoring environment, this box (which is dynamically updated) reflects the actual playback speed. Actual playback speed can differ from the frames-per-second setting you selected in the Document Properties dialog boxoften as the result of processor-intensive animation, which can cause your movie to slow in some segments.
Figure 10.5 The various elements of the timeline status bar.
Double-clicking the frame-rate area of the timeline status bar will open the Document Properties dialog box.
Elapsed time. Indicates the amount of time (in seconds) between the first frame of your movie and the current frame. The number is dynamically updated as you play your movie in the authoring environment.
Choosing the Proper Frame Rate
In one of the old I Love Lucy episodes, Lucy and Ethel get jobs packing chocolates into boxes as they come off an assembly line. In this classic TV scene, a malfunctioning conveyor belt begins spitting out chocolates faster then Lucy and Ethel can process themso the gals resort to stuffing candies in their mouths to keep pace. A huge messand much hilarityensue.
The timeless lesson here is that faster is not always better. Although it would be nice if you could increase your movie's frame rate to create video-like transitions that never skipped, jumped, or appeared choppy, Flash's reliance on processor speed means this is not always possible. In fact, a higher frame rate can potentially harm your presentation.
Regardless of what frame rate you choose, the different processors used to play your movie can handle information only so quickly. And because there's such a great range of processor speeds out there, you can't possibly know just how fast that is. If a particular computer can render your movie properly at a maximum rate of 20 fps, setting Flash's fps to 100 won't improve matters. That computer will still show your movie at 20 fpsmax. Although a faster computer may be able to play the same movie at 100 fps, few of us own the super machines capable of this.
So increasing a movie's speed doesn't help; in fact ,it could even slow things down .Here's how: Let's say your presentation is 10 seconds long. At 12 fps, there are 120 frames (10 seconds ´ 12 fps) that need to be played through from beginning to end. If you increase your fps rate to 20, you will have 200 frames from start to finishor an additional 80 frames to draw over the course of your presentation. While slower computers can handle 120 frames over 10 seconds fairly easily ,those additional 80 frames could slow your movie to a crawl because they create more than 60 percent more work for the computer to perform in the same 10 seconds (or over the course of your presentation). As a result, you could end up with precisely the opposite effect you were trying to achieve!
So, what's a reasonable frame rate? The default setting of 12 fps is usually a good compromise, with 20 fps at the high end and 24 fps the absolute maximum you should consider ,in our opinion. The only exception might be if you were to export your Flash presentation as a video file such as QuickTime or Windows AVI. Because these formats are not as processor intensive, you can pump up the frame rate without too many problems.
Flash still allows you to produce impressive results within these parameters. There are many examples of beautiful and exciting Flash content on the Web that have been created using these same fps guidelines. All it takes is some planning.
Center Frame Button
If you click the Center Frame button in the lower left of the timeline, Flash centers the playhead's current frame position on the timeline. This means that if you scroll to Frame 900 of a 1,000-frame movie while the playhead remains on Frame 200, clicking this button will cause the timeline to quickly scroll back to Frame 200, with the play-head centered on the timeline display (Figure 10.6).
Figure 10.6 Clicking the Center Frame button positions the playhead on the center of the timeline display.
Frame View Options
The Frame View button, which is located in the upper right of the timeline window, allows you to set different modes for viewing frames on the timeline. By clicking this button, you are presented with the following options:
Frame Width. Options include Tiny, Small, Normal, Medium, and Large (Figure 10.7).
Figure 10.7 The effect of the Frame Width setting on the timeline.
Frame Height. This option reduces the display height of frames on the timeline by 20 percent. If your movie contains a number of layers, choosing this option shrinks the entire stack of layers in a scene, so that more layers are displayedand you can spend less time scrolling the timeline to access frames on a particular layer.
Tinted Frames. By default, sections of frames are tinted different colors to help you distinguish them. You can turn this option on or off (see the next section for more details).
Preview. This option causes the graphics on each frame in every layer to be displayed within the boxes on the timeline that represent frames. Flash automatically scales the graphics to fit within the frame boxes (Figure 10.8).
Figure 10.8 The graphics in each frame are scaled to fill the boxes representing frames on the timeline.
Preview in Context. This option is similar to Preview, except that graphics are scaled to reflect their size as they will appear in the overall movie (Figure 10.9).
Figure 10.9 The graphics in each frame, shown at their designated size within the overall movie, appear in boxes representing frames on the timeline.
The context-sensitive Timeline menu provides quick access to several timeline-related commands, including adding and deleting frames, defining frame properties, creating motion tweens, and more (Figure 10.10).
Figure 10.10 The Timeline menu.
To display the Timeline menu:
Right-click (Windows) or Control-click (Macintosh) any frame on the timeline to make the Timeline pop-up menu appear, with the following options:
Create Motion Tween. Uses the current frame's content to automatically create a motion tween. To do so, it converts all content into graphic symbols. We discuss this option in more detail later in the chapter.
Insert Frame. Adds a regular frame after the currently selected one. If you select a range of regular frames, Flash will add that number of frames to the timeline. If you select a placeholder frame, Flash will add regular frames up to the point of the selected placeholder frame.
Remove Frames. Deletes the currently selected frame. If you select a range of frames, this command deletes all of them.
Insert Keyframe. Inserts a keyframe on the timeline, at the point where the cursor was located when you activated the menu. If a regular frame was at this position, the keyframe replaces it; if a placeholder frame was at this position, a keyframe is inserted and regular frames are added so that there are no placeholder frames prior to the newly inserted keyframe. A newly inserted keyframe starts out with the same content as the previous keyframe.
Insert Blank Keyframe. Inserts a blank keyframe on the timeline at the position where the cursor was located when the menu was activated. This command executes in the same fashion as the Insert Keyframe command above.
Clear Keyframe. Converts the selected keyframe to a regular frame. If a range of keyframes is selected, this command converts all of them.
Convert to Keyframes. Converts the selected frame to a keyframe. If a range of frames is selected, this command converts all of them.
Convert to Blank Keyframes. Converts the selected frame to a blank keyframe. If a range of frames is selected, this command converts all of them.
Cut Frames. Cuts a frame or range of frames for pasting elsewhere. Copy Frames. Copies a frame or range of frames for pasting elsewhere. Paste Frames. Pastes any frames on the clipboard onto the timeline after the currently selected frame. If the clipboard contains a range of frames across multiple layers, these frames and layers will be pasted onto the timeline in their same relative positions.
Clear Frames. Removes the graphical content of any selected frames. Select All Frames. Selects all frames on all unlocked and visible layers of the current scene. This is useful for duplicating entire scenes.
Reverse Frames. Flips, or reverses, the positions of the currently selected range of frames. The result is reversing their playback order.
Synchronize Symbols. Displays looped graphic symbols properly, even if the loop occupies an odd number of frames on the main timeline. For example, if you placed an instance of a graphic symbol with a timeline that looped every 10 frames on the main timeline to play over a stretch of 20 frames, it would loop twice without a hitch. If, however, you placed an instance of this same symbol on the main timeline to play over a stretch of 17 frames, it would loop once and then be abruptly cut off at Frame 17 during the second loop. By synchronizing symbols, you ensure that the graphic symbol will loop properly within the allotted frames on the main timeline.
Actions. Opens the Actions panel so that you can add frame actions. Properties. Displays or hides the Property inspector.
Most of these commands are also available on the Insert and Modify > Frames menus on the menu bar. When selected, they affect the currently selected frame or range of frames.