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

Chapter 10. Events and Event Handling > Dynamic Movie Clip Event Handlers

10.15. Dynamic Movie Clip Event Handlers

Earlier in this chapter, we saw that Flash 5-style on( ) and onClipEvent( ) handlers cannot be changed or removed during movie playback. Furthermore, onClipEvent( ) event handlers cannot be attached to the main movie timeline (the _root) of any movie.

In order to work around these limitations, we can—in the case of onClipEvent(enterFrame) and the movie clip mouse and key events—use empty movie clips to simulate dynamic event-handler removal and alteration. Empty movie clips even let us simulate onClipEvent( ) handlers for the main timeline. Follow these steps to see how it works (note that the following technique applies to Flash 5 only, because event handler properties in Flash MX can be removed directly via delete):


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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