Creating Interactive Movies > Assigning actions to objects > Setting mouse event options

Setting mouse event options

Assigning an action to a button also automatically assigns a Mouse Event action to the button to handle, or manage, the action.

Each handler begins with the word on, followed by the event to which the handler responds.

For example:

on (release)
on (keyPress "<Space>")
on (rollOver)

The release parameter indicates that the user pressed and released the mouse button.

You can specify which mouse events trigger a button action using the Actions panel.

To set mouse event options:

1 Select the button to which you'll assign an action.
2 In the Toolbox list on the left side of the Actions panel, click the Basic Actions category to display the basic actions.
3 Choose from the following options:
Select the On Mouse Event action.
Select an action in the Basic Actions category.
4 In the Parameters pane, for Event, select a keyboard or mouse event that will trigger the action:
Press triggers the action when the mouse button is pressed while the pointer is over the button.
Release (the default) triggers the action when the mouse button is released while the pointer is over the button. This sets up standard clicking behavior.
Release Outside triggers the action when the mouse button is released while the pointer is not over the button.
Key Press triggers the action when the specified key is pressed. If you select this option, enter the key in the text box.
Roll Over triggers the action when the pointer rolls over the button.
Roll Out triggers the action when the pointer rolls outside the button.
Drag Over triggers the action when the mouse button is pressed while the pointer is over the button, the pointer is rolled off the button, and then the pointer is rolled back over the button.
Drag Out triggers the action when the mouse button is pressed over the button and the pointer then rolls off the button.
5 Assign any additional actions to the button.

For more information on mouse events, see ActionScript Help.

To test frame actions:

1 Choose Control > Enable Simple Frame Actions.
2 Choose Control > Test Movie.