Flash keeps track of every event that occurs while your animation plays, beginning with the instant Flash Player loads your animation and continuing through every frame Flash plays, every button your audience clicks, every key they press— basically, just about everything that happens in (or to) your animation.
You can tie an action to any event. The following sections show you how to tie actions to the most common events: when your animation loads, and when your audience clicks a button, mouses over a hotspot, or chooses an option from a list.
In Chapter 7, you saw how to create groovy-looking button symbols (and where to find the button symbols that come with Flash), as well as how to change the appearance of a button when someone mouses over it.
This section shows you how to tie a button to an action so that when your audience clicks the button, Flash does something.
The example below uses a quick and easy behavior to tell Flash to load an additional animation when your audience clicks a button. But you can substitute a different behavior (or your own custom ActionScript code) to tell Flash to go to a different frame in the current animation, load a Web page, play a sound—just about anything you like.