Le 25 juil. 05 à 18:06, Jos Yule a écrit :
Hmmm... I thought about this, but I thought it would break the
inheritance with MovieClip, it sounds kind of too hackish (but
may actually work !). You mentioned SWFmill, do you have any
method to ensure that a MTASC-compiled MovieClip can be
instanciated ?
Just make sure that Cow extends movieClip and the above will work.
It is not hackish, as this is what the AS2 code gets converted into
when complied.
Ah ok... I just thought that ECMAScript/ActionScript was purely a
prototype-based language, hence simulating inheritance with the
__proto__ chain. If you are sure that changing the __proto__ slot of
an object doesn't affect its inheritance tree, then what you state
would be the best solution (ie. composition).
Are you sure you need to sub-class MovieClip? I find that most
everything can use composition, which is can be an easier style to
use. Most objects that you'd create aren't really in a kind-of
relationship with movieClips. They might use a MC to display
themselves on screen, but they aren't MCs...
Yes, you're right, and I would definitely use composition in the way
you mention.
Thanks for the pointers :)
-- Sébastien
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org