EasyManua.ls Logo

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT - Page 583

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT
816 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...
on() 583
on()
Availability
Flash 2. Not all events are supported in Flash 2.
Usage
on(mouseEvent) {
// your statements here
}
Parameters
statement(s)
The instructions to execute when the mouseEvent takes place.
A
mouseEvent is a trigger called an event.” When the event takes place, the statements
following it within curly braces execute. Any of the following values can be specified for the
mouseEvent parameter:
press The mouse button is pressed while the pointer is over the button.
release The mouse button is released while the pointer is over the button.
releaseOutside The mouse button is released while the pointer is outside the button after
the button is pressed while the pointer is inside the button.
rollOut The pointer rolls outside of the button area.
rollOver The mouse pointer rolls over the button.
dragOut While the pointer is over the button, the mouse button is pressed and then rolls
outside the button area.
dragOver While the pointer is over the button, the mouse button has been pressed then
rolled outside the button and then rolled back over the button.
keyPress ("key") The specified key is pressed. For the key portion of the parameter,
specify a key code or key constant. For a list of key codes associated with the keys on a standard
keyboard, see Appendix C, “Keyboard Keys and Key Code Values,” on page 789; for a list of
key constants, see “Property summary for the Key class” on page 408.
Description
Event handler; specifies the mouse event or keypress that triggers an action.
Example
In the following script, the startDrag() action executes when the mouse is pressed and the
conditional script is executed when the mouse is released and the object is dropped.
on(press) {
startDrag("rabbit");
}
on(release) {
trace(_root.rabbit._y);
trace(_root.rabbit._x);
stopDrag();
}
See also
onClipEvent()

Table of Contents

Related product manuals