Search code examples
actionscript-3optimizationtween

Optimizing tweens


What is the best way to clean up after tweens in AS3 no matter what library you are using (or the built-in tween classes). Is there a best-practice or is it specific to each tween library?


Solution

  • If with "clean up" you mean to clean up the memory used for animations in flash, try

    System.gc();
    

    to fire the garbage collection. It will sweep everything out what is not used or lost its reference.

    Recycling is also a good idea, even though it highly depends on your coding style and actual project.

    For more information on the garbage collection, see the reference.