Flash CS3 Documentation |
|||
| Learning ActionScript 2.0 in Adobe Flash > Handling Events > 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. 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 that a movie clip uses, you use the hitArea (MovieClip.hitArea property) property.
_up in the Property inspector.
stop();
stop() action on Frame 10 of the actions layer, and add a frame label of _over in frame 10 of the labels layer.on() event handler to the movie clip instance, as discussed in Using button and movie clip event handlers).onPress, onRelease, and so forth), as discussed in About ActionScript and events.Move your mouse pointer over the movie clip instance on the Stage and the movie clip automatically goes to the movie clip's _over state. Click the movie clip instance and the playhead automatically goes to the movie clip's _down state.
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00000845.html