Flash Player provides built-in garbage collection that frees up memory by destroying
objects that are no longer used. To ensure that the garbage collector destroys your
unused objects, remove all references to that object, including the parent’s reference
to the child.
On containers, you can call the removeChild() or removeChildAt() method to remove
references to child controls that are no longer needed. The following example removes
references to button instances from the myVBox control:
example:
<![CDATA[
private function destroyButtons(e:Event):void {
myVBox.removeChild(b1);
myVBox.removeChild(b2);
myVBox.removeChild(b3);
}
]]>
You can clear references to unused variables by setting them to null in your ActionScript; for example:
myDataProvider = null
To ensure that destroyed objects are garbage collected, you must also remove event
listeners on them by using the removeEventListener() met

February 25, 2008 at 12:48 pm |
Hi
February 25, 2008 at 12:49 pm |
Hi,
I want to know how to garbage collect strings
May 19, 2008 at 8:35 am |
yes yes neelam, i also want to know how objects r garbage collected. plz help me….