Button Actions

   

Button actions are placed on the instance of a button on the stage, and not on the Timeline. Combining buttons with actions lets you create interactivity. These actions dictate where an end user is directed once a button is activated. You can determine this by using the On Mouse Event action. You can create one button and use different instances of the button with their own set of actions on them.

The On Event Handler

The on event handler lets you attach actions to mouse events. It is used in addition to other actions, such as the goto , getURL , and stop actions. Whenever you choose a complimentary action, Flash detects that you are adding this functionality to a button and automatically attaches the on action before it.

The on event handler has many mouse events associated with it. For a list of these and a summary of each one, see Table 7.2.

Table 7.2. Mouse Events

EVENT

MEANING

Press

Mouse button is pressed within the clickable area of a button.

Release

Mouse button is released after a press within the clickable area of a button.

Release Outside

Mouse button is released outside the clickable area of a button, although the press was within the clickable area. This lets the end user change his or her mind after clicking but before releasing.

Key Press

Lets the end user provoke an action when a specified keyboard key is pressed.

Roll Over

Cursor is over the clickable area of a button.

Roll Out

Cursor moves away from the clickable area of a button after being over it.

Drag Over

Mouse button is pressed down within the clickable area of a button. The cursor is then moved outside the button's clickable area with the button still pressed, and the cursor moves back into the button's clickable area.

Drag Out

Mouse button is pressed within the clickable area of a button. The cursor is then moved outside the button's clickable area with the button still pressed.

You can add multiple actions to a mouse event. These and other actions are covered in further detail in Chapter 9, "Introduction to ActionScript."


   
Top


Certified Macromedia Flash MX Designer Study Guide
Certified Macromedia Flash MX Designer Study Guide
ISBN: 0321126955
EAN: 2147483647
Year: 2001
Pages: 142

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net