Could you send the parameters/arguments into a text file and retrieve them from there using loadVars? John
----- Original Message ----- From: "Miguel Serrano" <[EMAIL PROTECTED]> To: <flashcoders@chattyfig.figleaf.com> Sent: Sunday, August 20, 2006 6:45 PM Subject: Re: [Flashcoders] ClassFactory and Reflection in Actionscript > Oh, it's very sad. I developed a script language that can be loaded > and run at runtime in a flash movie. > > At this moment I can create instances with no arguments, it's very > impressive, but if I can not pass arguments I can't continue the > project. > > > > > > > I'm coding an introspection framework for as3, but i have a problem by > > > creating instance at runtime without using new operator. > > > > > I have no problem to create instances of classes with no operators at > > > its construction function. The code is this one: > > > > > public class ClassFactory{ > > > > > public static function createInstance(className:String):Object > > > var clazz:Class = getDefinitionByName(className) as Class; > > > return new clazz() > > > } > > > } > > > > > I need a factory to create instance with an array of arguments, of this kind: > > > > > public static function createInstance(name:String, args:Array):Object > > > > > any idea?? > > > > Unfortunately this can't be done in AS3. I asked this before and the > > workaround suggested by an Adobe engineer was to use a "well known > > initialization method" in your classes and call them after invoking > > the constructor. But this is obviously not feasible if you need to > > work with existing classes and/or want to create a generic framework > > with such capabilities. This is one of the areas where you have more > > limitations in AS3 than you used to have in AS2. I really hope AS4 > > will introduce something like: Class.newInstance(args:Array) > > > > > > Jens > > www.oregano-server.org > > > > > _______________________________________________ > Flashcoders@chattyfig.figleaf.com > 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 > _______________________________________________ Flashcoders@chattyfig.figleaf.com 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