31
2
CHAPTER 2
Writing and Editing
ActionScript 2.0
When you write ActionScript code in Macromedia Flash Basic 8 or Macromedia Flash
Professional 8, you use the Actions panel or Script window. The Actions panel and Script
window contain a full-featured code editor (called the
ActionScript editor
) that includes code
hinting and coloring, code formatting, syntax highlighting, syntax checking, debugging, line
numbers, word wrapping, and support for Unicode in two different views. For more
information about the ActionScript editor, see
“Using the Actions panel and Script window”
on page 35
.
You can use one of two methods to write ActionScript code in Flash. You can write scripts that
are part of your Flash document (that is, scripts that are embedded in the FLA file), or you
can write external scripts (scripts or classes that are stored in external files). You cannot use the
Actions panel to write external scripts.
When you write scripts inside a FLA file, you use the ActionScript editor in the Actions panel.
The Actions panel contains the ActionScript editor in a Script pane and supporting tools to
make writing scripts easier. These tools include the Actions toolbox, which gives you quick
access to the core ActionScript language elements; the Script navigator, which helps you
navigate between all of the scripts in your document; and Script Assist mode, in which you are
prompted for the elements needed to create scripts. For more information about the Actions
panel, see
“About the Actions panel” on page 36
. For more information about Script Assist,
see
“About Script Assist” on page 58
.
When you need to create an external script, you use the ActionScript editor in the Script
window to create a new ActionScript file. (You can also use your favorite text editor to create
an external AS file.) In the Script window, the ActionScript editor includes code-assistance
features like code hinting and coloring, syntax checking, and so on just like the Actions panel.
For more information about the Script window, see
“About the Script window” on page 37
.
Flash offers further scripting assistance through behaviors. Behaviors are predefined
ActionScript functions that you can attach to objects in your Flash document without having
to create the ActionScript code yourself. For more information about behaviors, see
“About
behaviors” on page 61
.
Summary of Contents for FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Page 1: ...Learning ActionScript 2 0 in Flash...
Page 8: ...8 Contents...
Page 18: ...18 Introduction...
Page 30: ...30 What s New in Flash 8 ActionScript...
Page 66: ...66 Writing and Editing ActionScript 2 0...
Page 328: ...328 Interfaces...
Page 350: ...350 Handling Events...
Page 590: ...590 Creating Interaction with ActionScript...
Page 710: ...710 Understanding Security...
Page 730: ...730 Debugging Applications...
Page 780: ...780 Deprecated Flash 4 operators...
Page 830: ...830 Index...