EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Using the Actions Panel and Script Window

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Using the Actions panel and Script window 35
When you use behaviors, which are predefined ActionScript functions (see About behaviors
on page 61), other workflow and code organization issues must be considered.
About writing scripts to handle events
Writing code for events can be categorized into two major groups: events that occur on the
timeline (in keyframes) and those that occur on object instances (move clips, buttons, and
components). The interactivity of your SWF file or application can be scattered over the
many elements in your project, and you may be tempted to add scripts directly to these
elements. However, Macromedia recommends that you do not add scripts directly to these
elements (keyframes and objects). Instead, you should respond to events by calling functions
that reside in a central location, as described in “Organizing ActionScript code.
Using the Actions panel and
Script window
To create scripts within a FLA file, you enter ActionScript directly into the Actions panel. To
create external scripts that you include or import into your application, you can use the Script
window (File > New and then select ActionScript File) or your preferred text editor.
When you use the Actions panel or Script window, you are using features of the ActionScript
editor to write, format, and edit your code. Both the Actions panel and Script window have
the Script pane (which is where you type your code) and the Actions toolbox. The Actions
panel offers a few more code-assistance features than the Script window. Flash offers these
features in the Actions panel because they are especially useful in the context of editing
ActionScript within a FLA file.
To display the Actions panel, do one of the following:
Select Window > Actions.
Press F9.
To display the Script window, do one of the following:
To begin writing a new script, select File > New and then select ActionScript File.
To open an existing script, select File > Open, and then open an existing AS file.
To edit a script that is already open, click the document tab that shows the scripts name.
For more information, see the following topics:
About the Actions panel” on page 36
About the Script windowon page 37

Table of Contents

Related product manuals