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
  • PrintPrint
Share this Page URL
Help

Chapter 14. Garbage Collection > Deactivating Objects

14.4. Deactivating Objects

We've learned that removing all references to an object makes that object eligible for garbage collection. However, even after an object becomes eligible for garbage collection, it continues to exist in memory until ActionScript decides to "sweep" it away during a garbage collection cycle. After the object becomes eligible for garbage collection, but before it is actually removed from system memory, the object continues to receive events and, in the case of Function objects, can still be triggered by setInterval( ).

For example, imagine a slideshow application that uses a class, ImageLoader, to load images from a server at regular intervals. The code for the ImageLoader class is as follows:


  

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


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint