Add Actions To Frames - MACROMEDIA FLASH 8-GETTING STARTED WITH FLASH Getting Started

Table of Contents

Advertisement

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
adding
methods, you cause the playhead to stop and wait at
stop()
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
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.
movie clip. By
slideShow
movie
slideShow

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents