Specifications
225
19
CHAPTER 19
ActionScript: Write 
Scripts 
The ActionScript language that is part of Macromedia Flash Basic 8 and 
Macromedia Flash Professional 8 offers designers and developers a variety 
of benefits. With ActionScript you can control document playback in 
response to events such as elapsed time and loading data; add interactivity 
to a document in response to user actions, such as a button click; use built-
in objects, such as a button object, with built-in associated methods, 
properties, and events; create custom classes and objects; and create more 
compact and efficient applications than you could create using user 
interface tools, all with code that you can reuse.
ActionScript is an object-oriented scripting language that offers control 
over how your Flash content plays. In subsequent lessons, you’ll see how 
ActionScript has evolved into ActionScript 2.0 to comprise a core set of 
language elements that make it easier to develop object-oriented programs. 
You can print this tutorial by downloading a PDF version of it from the 
Macromedia Flash Documentation page at www.macromedia.com/go/
fl_documentation.
In this tutorial, you will complete the following tasks:
Set up your workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Create an instance of a symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Name button instances. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Initialize the document  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Apply ActionScript syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  229
Locate ActionScript reference documentation. . . . . . . . . . . . . .  230
Add comments to ActionScript. . . . . . . . . . . . . . . . . . . . . . . . . . . .  230
Write a function for a button  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Copy and modify a button function  . . . . . . . . . . . . . . . . . . . . . . . . 232
Check syntax and test your application. . . . . . . . . . . . . . . . . . . . . 233










