
108 Tutorial: Building Your First Flash Application
Add actions to frames
In this section, you will add a small amount of ActionScript to control how
the playhead moves through the Timeline of the
slideShow
movie clip. By
adding
stop()
methods, you cause the playhead to stop and wait at
certain frames. Later you will add ActionScript code to make the playhead
move again.
To add the ActionScript code:
1.
In the Timeline, select Frame 1 of Layer 2.
2.
Select Modify > Timeline > Convert to Keyframes.
This adds a keyframe to the frame, so now there are keyframes in
Frames 1 and 2 of Layer 2.
3.
Select Frame 1 of Layer 2.
4.
Open the Actions panel (Window > Actions).
If the Actions panel is in Script Assist mode (you will see the text “To
add an item, double-click or drag the item to the Script window” and
will be unable to type in the Script window), click the Script Assist
button in the Actions panel to exit Script Assist mode.
5.
In the Actions panel, type the following ActionScript:
stop();
This code causes the playhead to stop playing the
slideShow
movie
clip whenever it reaches Frame 1. A small
a
appears in Frame 1 of
Layer 1 of the Timeline. This indicates that ActionScript is present in
that frame.
6.
In the Timeline, select Frame 20 of Layer 2.
7.
Select Modify > Timeline > Convert to Keyframes.
8.
Select Frame 20 of Layer 2.
9.
In the Actions panel, type the
stop();
ActionScript.
10.
In the Timeline, select frame 40 of Layer 2.
11.
Select Modify > Timeline > Convert to Keyframes.
12.
Select frame 40 of Layer 2.
13.
In the Actions panel, type the
stop();
ActionScript.
14.
In the Timeline, select frame 60 of Layer 2.
15.
Select Modify > Timeline > Convert to Keyframes.
000_Getting_Started.book Page 108 Friday, September 2, 2005 12:22 PM
Содержание FLASH 8-GETTING STARTED WITH FLASH
Страница 1: ...Getting Started with Flash...
Страница 26: ...26 Introduction...
Страница 94: ...94 Flash Basics...
Страница 152: ...152 Index...