Creating movie clips with button states

When you attach an on() handler to a movie clip, or assign a function to one of the MovieClip mouse event handlers for a movie clip instance, the movie clip responds to mouse events in the same way as a button does. You can also create automatic button states (Up, Over, and Down) in a movie clip by adding the frame labels _up, _over, and _down to the movie clip's Timeline.

When the user moves the mouse over the movie clip or clicks it, the playhead is sent to the frame with the appropriate frame label. To designate the hit area used by a movie clip, you use the hitArea property of the MovieClip class.

To create button states in a movie clip:

  1. Select a frame in a movie clip's Timeline to use as a button state (Up, Over, or Down).
  2. Enter a frame label in the Property inspector (_up, _over, or _down).
  3. To add additional button states, repeat steps 1-2.
  4. To make the movie clip respond to mouse events, do one of the following: