If you load a .swf file into Flash Player 9 with ActionScript 3.0 and subsequently wish to remove it from memory, you must first deactivate it, and then dereference it. If you dereference the .swf without deactivating it, it will continue to consume resources and in some cases might never become eligible for garbage collection.
Here is an unofficial list of tasks required to deactivate a .swf file:
Note that the preceding list is, by definition, insufficient because it is neither exhaustive nor officially maintained by Adobe. If you know of a task that needs adding to the preceding list, please sent it to me via email (username colin, domain moock.org).
As of Flash Player 10, the preceding tasks can be performed automatically by calling the Loader class's new method unloadAndStop().
For further discussion, see Charge #2 in my Inside RIA article, The Charges Against ActionScript 3.0 and Grant Skinner's article Additional Information on Loader.unloadAndStop().
Posted by moock at July 15, 2008 09:18 PM