N-R > on |
![]() ![]() ![]() |
on
on, mouse handler, event handler
Availability
Flash 2. Not all events are supported in Flash 2.
Usage
on(
mouseEvent
) {
statement(s);
}
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 brackets execute. Any of the following values can be specified for the mouseEvent
parameter:
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
Description
Event handler; specifies the mouse event, or keypress that trigger 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
![]() ![]() ![]() |