How to make Flex / ActionScript 3 objects eligible for garbage collection?

advertisements

How do I make Flex/ActionScript 3 objects eligible for garbage collection? What are the thumb rules? ... apologies if this was answered else where.


Basically you need to remove all of the objects event listeners and delete all references to it making it completely un-available to the rest of your application.

removing event listeners is fairly intiutive with *.removeEventListener(event type, function) and to remove a references use delete(varName).

doing the above will work most of the time but there are still some cases where this is not enough and to really take advantage of garbace collection you need to incorporate supporting practices in all areas of your code, not just when you want to remove something.

zombiegx posted your two greatest assets when looking for more information.