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

Chapter 3. Your First ActionScripts > Messing with Movie Clips

Messing with Movie Clips

Now that you know how to handle an event using a button (using the on() method we just talked about), let's look at handling events with movie clips. Movie clips have an event handler too, but it's called onClipEvent. Probably the biggest difference between on and onClipEvent is that, when it comes to mouse buttons, on can only see what happens directly on top of the button, while onClipEvent looks at the whole movie clip and the movie clip timeline. For example, if you click your mouse button down and up outside of a button, an on action will never see your mouse click. But a movie clip, which has to use onClipEvent, scans the entire movie and will see your mouse click, even if you clicked nowhere near the movie clip.

As you continue programming in ActionScript, you'll come across times when on will be most helpful and other times when onClipEvent will be the best choice.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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