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

Chapter 10. Events and Event Handling > Refreshing the Screen with updateAfterE...

10.13. Refreshing the Screen with updateAfterEvent( )

The MovieClip event handler properties onMouseDown( ), onMouseUp( ), onMouseMove( ), onKeyDown( ), and onKeyUp( ) are executed immediately upon the occurrence of their corresponding events. Immediately means immediately—even if the event in question occurs between the rendering of frames.

This immediacy can give a movie great responsiveness, but that responsiveness can easily be lost by improper coding. By default, the visual effects of onMouseDown( ), onMouseUp( ), onMouseMove( ), onKeyDown( ), and onKeyUp( ) are not physically rendered by the Flash Player until the next available frame is rendered. To see this in action, create a single-frame movie with a frame rate of 1 frame per second. Place a movie clip named circle_mc on the Stage and attach the following code to frame 1 of the main timeline:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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