Hello Flashcoders,

I have a clip (myClip_mc) associated with class, which is subclassing MovieClip
(say, MyClass1).
class MyClass1 extends MovieClip ...

To do this, I entered class name as "AS 2.0 Class" in "Export for
Actionscript" dialog.
All this works OK (of course).

But under some circumstances I'd like this clip to be associated with
ANOTHER class (say, MyClass2).
class MyClass2 extends MovieClip  ...

How do I acomplish this in good OOP style?
Few ways I can imagine right now are:
1) myClip_mc.prototype.__proto__ = MyClass2.prototype;
2) Create an "instantiate()" method in MyClass2 to re-write all
props/methods of the target clip with ones of MyClip2 (similar to
EventDispatcher).

Both "ways" above don't seem good from OOP point of view, though...

Can anyone offer something more elegant?




-- 
Best regards,
 GregoryN                        
================================
http://GOusable.com
Flash components development.
Usability services.

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to