Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

22.5. Enterframe Events

I touched on enter frame events in Chapter 14, "Visual Programming with the Display List." Display objects that are on the display list dispatch two events—Event.ENTER_FRAME and Event.EXIT_FRAME—as frames are drawn, one before the frame is drawn, and one after. The rate that frames are drawn is set by the stage's frame rate (which you can modify in the frameRate property), but it is not guaranteed. Nonetheless, triggering updates from frame events is a good idea because it ensures that your updates are performed at the same rate as the display is refreshed. You have seen this used in numerous examples by now, such as Example 7 (http://actionscriptbible.com/ch7/ex1). I'll introduce more information about using enterframe events for animation in Chapter 39, "Scripting Animation."


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial