28
Chapter 3: Write Scripts with ActionScript
Set up your workspace
First, you’ll open the start file for the lesson and set up your workspace to use an optimal layout
for taking lessons.
1.
To open your start file, in Flash select File > Open and navigate to the file:
■
On Windows 2000 or XP, browse to
boot drive
\ Documents and Settings\All Users\
Application Data\Macromedia\Flash MX 2004\
language
\Configuration\ HelpPanel\
HowDoI\ QuickTasks\start_files and double-click scripts_start.fla.
Note:
If the Application Data folder is hidden, you’ll need to change your Windows Explorer
settings to see the folder.
■
On Windows 98, browse to
boot drive
\Windows\ Application Data\Macromedia\Flash MX
2004\
language
\Configuration\HelpPanel\ HowDoI\QuickTasks\start_files and double-click
scripts_start.fla.
■
On Macintosh, browse to
Macintosh HD
/Users/Shared/Application Support/Macromedia/
Flash MX 2004/
language
/Configuration/HelpPanel/HowDoI/QuickTasks/start_files and
double-click scripts_start.fla.
Note:
The QuickTasks\finished_files folder contains completed versions of lesson FLA files, for
your reference.
2.
Select File > Save As and save the document with a new name, in the same folder, to preserve
the original start file.
3.
Select Window > Panel Sets > Training Layout to modify your workspace for taking lessons.
Create an instance of a symbol
You’ll drag an instance of an animated movie clip from the library to the Global Positioning
System artwork on the Stage. You’ll then follow the recommended practice of always naming
instances—both to prompt code-hinting and because in your scripts you generally refer to
instance names rather than symbol names. Code hints are the tooltips that prompt you with the
correct ActionScript syntax.
1.
In the Tools panel, click the Selection tool. Select the map layer in the Timeline, and click the
padlock next to the map layer to unlock that layer.
2.
To place the movie clip accurately, select View > Snapping. Select Snap Align and Snap to
Objects if the commands are not already selected.
3.
From the Library panel (Window > Library), drag map_skewed to the black background area
of the Stage.
Because guides don’t appear when you first drag an object from the Library panel, you’ll release
the object and then drag it again.
Summary of Contents for FLASH MX 2004-LEARNING FLASH
Page 1: ...Learning Flash...
Page 8: ...8 Contents...
Page 34: ...34 Chapter 3 Write Scripts with ActionScript...
Page 54: ...54 Chapter 6 Create a User Interface with Layout Tools...
Page 62: ...62 Chapter 7 Draw in Flash...
Page 68: ...68 Chapter 8 Create Symbols and Instances...
Page 76: ...76 Chapter 9 Add Animation and Navigation to Buttons...
Page 104: ...104 Chapter 13 Add Interactivity with ActionScript...
Page 112: ...112 Chapter 14 Create a Form with Conditional Logic and Send Data...
Page 122: ...122 Chapter 15 Work with Objects and Classes Using ActionScript 2 0...