EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - About Actionscript and Events; For more Information on Handling Events, See the Following Sections: about Actionscript and Events

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...
32 Writing and Editing ActionScript 2.0
For more information on handling events, see the following sections:
About ActionScript and events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Organizing ActionScript code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Using the Actions panel and Script window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
About the Actions panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
About the Script window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
About coding in the Actions panel and Script window. . . . . . . . . . . . . . . . . . . . . . . . . 38
About Actions panel features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
About behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
About ActionScript publish settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
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
Button.onRollOver or on(rollOver) event
occurs; when the user clicks a button, the
Button.onRelease event occurs; if a key on the
keyboard is pressed, the
on(keyPress) event occurs. You can write code on a frame or attach
scripts to an instance to handle these events and add all the interactivity you desire.

Table of Contents

Related product manuals