Introduction to Flash MX Tutorial > Add animation and navigation to buttons > Add actions to buttons

 

Add actions to buttons

When the user clicks the button and the tweened animation plays, you want the playhead to move to the end of the Button Animation Timeline, then stop. You use ActionScript, the Flash scripting language, to control playhead movement in a Timeline.

1

Add a new layer to the Button Animation Timeline and name it Actions.

2

On the Actions layer, add a keyframe to Frame 15.

3

If the Actions panel is not open, choose Window > Actions. Enlarge the panel, if necessary, to view both the Actions toolbox and the Script pane.

4

With Frame 15 of the Actions layer selected, go to the Actions > Movie Control category of the Actions toolbox and double-click stop.

The stop action lets you specify that the playhead will stop when it reaches Frame 15.

In the Button Animation Timeline, Frame 15 of the Actions layer now displays a small a, which indicates that an action is attached to that frame.

Note: As you complete the tutorial, remember to save your work frequently.