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






Like the article? Share, bookmark or tweet it
Don't like it? There are lots of published articles, pick a random one.