We all know that Flash uses only reference counting to do garbage collection. So, we have come to the decision that it is a wise idea to take special care to dispose circular references as these tend to hang around a lot. In ActionScript, take care that you are cleaning up external references before destroying or unloading movieclips. Our internal team usually have a dispose method in most of the objects that nulls external references before hand.
// for movieclip subclasses
public function dispose ():Void
{
externalRef = null;
this.removeMovieClip ();
};
//
// for other class instances use something like
myObject.dispose ();
myObject = null;
Brajeshwar posted this article
on Wed, Jun 29th, 2005 at 6:48 pm
Categorized under Technology








Comments Post Yours
There are one response so far. You can follow any responses to this entry through the RSS feed. You can skip to the end and leave a response. Pinging is currently not allowed.
Do you have any AS examples that generate garbage waiting to be collected in flash player?
Thanks,
Kevin
Post yours