![]() ![]() | |
Flash 2. Not all events are supported in Flash 2.
on(mouseEvent) {// your statements here}
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 Keyboard Keys and Key Code Values; for a list of key constants, see Property summary for the Key class.Event handler; specifies the mouse event or keypress that triggers an action.
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();
}
![]() ![]() | |