
58
Chapter 4: Building Your First Application
For an online introduction to the Flash MX 2004 behaviors see the Macromedia On Demand
article “Flash MX 2004 Family: Using Behaviors” at
www.macromedia.com/macromedia/events/
online/ondemand/index.html.
Add motion and basic interactivity
The ad is almost complete. The next step before testing and publishing it is to add the motion
that makes the car fade away. With just a few keystrokes, you can add motion to an object using
the built-in Timeline effects provided with Flash.
Add a Timeline effect
Timeline effects are powerful tools that you can use to create an instant animation. In this
example, you’ll add a fade-out effect.
For more information about effects, see “Using Timeline effects” in
Using Flash
.
1.
With the Selection tool, click the car on the Stage.
The box around the car indicates that it is selected.
2.
Do one of the following:
■
Select Insert > Timeline Effects > Transition.
■
Right-Click (Windows) or Control-Click (Macintosh) and select Timeline Effects >
Transition from the context menu.
The Transition dialog box appears, displaying a preview of the effect, with default settings.
3.
Because you only want the car to fade, and you do not want a wipe transition, deselect Wipe.
4.
For the Direction, select Out for the car to fade out.
5.
Click Update Preview to view the effect with the new settings, then click OK.
A new layer named Transition 1 appears in the Timeline.
6.
In the Timeline, click the Transition 1 layer title and drag it up it so that it is the top layer and
the Art layer is the bottom layer. Otherwise, the content on the Art layer appears over the
content on the Transition 1 layer and hides the car.
7.
Select Control > Test Movie to test the document in Flash Player.
The car fades out as expected; however, the text and the rest of the artwork disappear from the
Stage very quickly, before the fade-out ends. The application continues to loop and play again.
Extend a layer in the Timeline
The reason the fade-out effect lasts longer than the rest of the application is apparent when you
look at the Timeline. The Fade Out 1 layer extends to Frame 30, whereas the Art layer is only on
Frame 1. As each frame is played in sequence, the Art layer (Frame 1) disappears until the
application loops back to the beginning. To solve this problem, you will simply extend the Art
layer so that it is longer than the Fade Out layer.
Содержание DIRECTOR MX 2004-GETTING STARTED WITH...
Страница 1: ...Getting Started with Flash...
Страница 14: ...14 Chapter 1 Getting Started...
Страница 68: ...68 Index...