views:

98

answers:

1

I would love to see an actual example how to use the casalib-garbage-collection. I used the destroy method like in the description: casa-lib description

If I have a Loader in a Subclass, do I also have to use the CasaLibLoader? Do I have still to care about all Instances/Eventlisteners to do proper garbage collection? If yes, whats the advantage of casalib-garbage-collection? I assumed to call destroy on a Casalib-Sprite and then it would destroy all its subclasses and references, and therefore safe memory. It would be awesome to get an easy instruction.

Thanks in advance

A: 

i read the casa-lib description and it sounds to me that as long as you use these special casa versions instead of the 'core AS3 classes' they add a destroy method (and some other convenience methods) to the class they extend.

This saves you from the trouble to remove every single listener you added to a a CasaSprite. Instead you just invoke the destroy method and all listeners you have previously added are removed automatically. Classes which have DisplayObject in their inheritance tree seem to also remove themselves from their parent.

So casa lib adds some convenience methods with the advantage to save you some typing and the disadvantange to couple your code tightly to casa lib.

maxmc