Re: [Flashcoders] AS3 version of the ol' dynamically-created constructor trick?

2007-09-06 Thread Peter Balogh
Thank you! That's exactly it. - Original Message From: Pedro Taranto [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Wednesday, September 5, 2007 11:16:39 PM Subject: Re: [Flashcoders] AS3 version of the ol' dynamically-created constructor trick? you can use: var

[Flashcoders] AS3 version of the ol' dynamically-created constructor trick?

2007-09-05 Thread Peter Balogh
In AS2, I always enjoyed the trick whereby you dynamically create Objects from a string describing their class: var classname:String = somepackage.SomeClass; var constructor:Function = eval( classname ); var myObject:Object = new constructor(); // makes an instance of class SomeClass Is this

Re: [Flashcoders] AS3 version of the ol' dynamically-created constructor trick?

2007-09-05 Thread Pedro Taranto
you can use: var classRef:Class = getDefinitionByName(MyClassNmae) as Class; var myInstance:* = new classRef(); -- Pedro Taranto ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: