About the Actions panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
About the Script window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
About behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
About ActionScript and events
In Macromedia Flash Basic 8 and Macromedia Flash Professional 8, ActionScript code is
executed when an event occurs: for example, when a movie clip is loaded, when a keyframe on
the timeline is entered, or when the user clicks a button. Events can be triggered either by the
user or by the system. Users click mouse buttons and press keys; the system triggers events
when specific conditions are met or processes completed (the SWF file loads, the timeline
reaches a certain frame, a graphic finishes downloading, and so on).
When an event occurs, you write an event handler to respond to the event with an action.
Understanding when and where events occur will help you to determine how and where you
will respond to the event with an action, and which ActionScript tools to use in each case. For
more information, see
"About writing scripts to handle events" on page
35.
Events can be grouped into a number of categories: mouse and keyboard events, which occur
when a user interacts with your Flash application through the mouse and keyboard; clip
events, which occur within movie clips; and frame events, which occur within frames on
the timeline.
For information about the kinds of scripts you can write to handle events, see
"About writing
scripts to handle events" on page
35.
Mouse and keyboard events
A user interacting with your SWF file or application triggers mouse and keyboard events. For
example, when the user rolls over a button, the
or
event
Button.onRollOver
on(rollOver)
occurs; when the user clicks a button, the
event occurs; if a key on the
Button.onRelease
keyboard is pressed, the
event occurs. You can write code on a frame or attach
on(keyPress)
scripts to an instance to handle these events and add all the interactivity you desire.
32
Writing and Editing ActionScript 2.0
Need help?
Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?
Questions and answers