About that, I was just looking at Tweener's code, and I don't think that
would be a problem either. It is basically a static class, so there's no
extra memory allocation for tween added, except for a relatively small
TweenListObj pushed into an array.

Or maybe I am wrong and Zeh can correct me ;)

Every engine will have additional memory spent for new instances - with Tweener, it's TweenListObj on the current version, which is basically an array containing references and data about timing and tweening parameters.

But obviously there are many reasons why the byte size of the compiled class isn't duplicated for new instances. This would be the case even for instances of a non-static class or for a single class (Tweener code is split on few different classes). The very reason we have classes is to keep code centralized instead of duplicating similar methods for every new object. The SWF byte code is completely different from the 'code' in memory anyway too.


Zeh
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to