|
Flash design tutorial ZONE
Add a Frame Action
By creating a little script, you can make the title stop on the last frame. Here you will add a Stop action to the last frame in the timeline.
The timeline is located at the top of the Flash workspace and is used in conjunction with the stage to create an animation. Notice that the transformation effect is indicated in the timeline, as shown in Figure 1-1. It is named “Transform” and it resides on a layer. Layers allow you to stack pictures or scripts on top of one another. There is also a gray bar that extends to the right and stops at the number 60, representing the frame number you selected in the Transform dialog box.
To get the animation to stop on frame 60 so it won’t loop, you need to place a Stop action on the last frame. Before adding the action, you will create another layer for the action. If the Stop action is placed on its own layer, it will be easy to see in the timeline.
1. To create another layer in the timeline, click the Insert Layer button in the bottom-left corner of the timeline, shown next. Clicking this button will add another layer to the timeline on top of the Transform layer.
2. To create a Stop action on this new layer, first click frame 60 in the new layer and press f6 (or select Insert | Timeline | Keyframe). Doing so will make a keyframe, which appears as a white circle, as you can see in the previous illustration. A keyframe is a frame in an animation in which a change in content occurs. When the Stop action is added on this keyframe, the animation will stop.
If pressing F6 does not produce a keyframe, select Insert | Timeline | Keyframe. Your computer may not be configured to recognize function keys in Flash.
FIGURE 1-1
A Transform effect applied to the title text fills in frames in the timeline.
3. Next, display the Actions panel by selecting Window | Actions or pressing f9 in Windows or option-f9 on the Mac. This will bring the panel forward even if it is already on the desktop. The Actions panel, shown here, is where you create scripts so you or your audience can control the movie.
Global Functions
Script Assist button
4. Click the Script Assist button (looks like a wand) in the upper-right column in the Actions panel, as shown in the illustration. This assists you in creating a script if you are a beginner at scripting in Flash. Underneath the Script Assist button is the script pane. This is the area where you build scripts for frames and objects. In the left column, click the Global Functions button to expand the contents.
5. Click the Timeline Control button to expand the contents and then double-click Stop. The word stop(); now appears in the script pane.
6. As you can see in the following illustration, the letter a now appears on the last frame in the timeline, indicating that there is a script on frame 60. When the movie is played, it will stop when it gets to the last frame.
|