on()
Availability
Flash 2. Not all events are supported in Flash 2.
Usage
on(mouseEvent) {
// your statements here
}
Parameters
statement(s)
A
is a trigger called an event. When the event occurs, the statements following it
mouseEvent
within curly braces ({ }) execute. Any of the following values can be specified for the
parameter:
mouseEvent
•
The mouse button is pressed while the pointer is over the button.
press
•
The mouse button is released while the pointer is over the button.
release
•
releaseOutside
rolls outside the button area just before it is released. Both the
always precede a
•
The pointer rolls outside the button area.
rollOut
•
The mouse pointer rolls over the button.
rollOver
•
While the pointer is over the button, the mouse button is pressed and then rolls
dragOut
outside the button area.
•
While the pointer is over the button, the mouse button has been pressed, then
dragOver
rolled outside the button, and then rolled back over the button.
•
keyPress "<key>"
parameter, specify a key constant. You can use this parameter to intercept a key press, that is, to
override any built-in behavior for the specified key. The button can be anywhere in your
application. One limitation of this technique is that you can't apply the
runtime; you must do it at authoring time. Make sure that you select Control > Disable
Keyboard Shortcuts, or certain keys with built-in behavior won't be overridden when you test
the application using Control > Test Movie.
For a list of key constants, see
key constants, see
Description
Event handler; specifies the mouse event or keypress that triggers an action.
190
Chapter 5: ActionScript Core Language Elements
ActionScript Core Language Elements
The instructions to execute when the
While the pointer is over the button, the mouse button is pressed and then
event.
releaseOutside
The specified keyboard key is pressed. For the
"Property summary for the Key class" on page
"Property summary for the Key class" on page
occurs.
mouseEvent
and the
press
portion of the
key
on()
295.
CHAPTER 5
events
dragOut
handler at
295. For a list of
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?