• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 15. Using Basic ActionScripts > Understanding a Clip Event

Understanding a Clip Event

Since clip events are attached to movie clips, the action is triggered by the event specified in the onClipEvent handler. You might want a specific movie clip to stop playing when another movie clip loads on the Stage, or when the user clicks or moves their mouse. The Clip Event is one of a series of event handlers that Flash uses to create actions within a Flash movie. You can attach event handlers directly to a button or movie clip instance by using the onClipEvent() or the on() handlers. The onClipEvent() handles movie clip events, and on()handles button events. To use an on() or onClipEvent() handler, attach it directly to an instance of a button or movie clip on the Stage, and then specify the event you want to handle for that instance. For example, the following on() event handler executes whenever the user clicks the button the handler is attached to.

on(press) {
  trace("The button has been pressed.");
}


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint