Shouldn't that be a params array?
var myStr:String = "org.foo.Bar";
var paramsArr:Array = new Array("robert", 12);
var myInstance:Object = new _global[myStr](paramsArr);
Jim
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Cedric
Muller
Sent: 12 April 2006 11:57
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Instantiate a class by string
you could have a 'paramsObj' Object that stores parameters ?
var myStr:String = "org.foo.Bar";
var paramsObj:Object = new Object();
paramsObj.name = "robert";
paramsObj.age = 12;
var myInstance:Object = new _global[myStr](paramsObj);
>>> var theCommand = new commands [ commandNameToCheck ] ();
_______________________________________________
[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
_______________________________________________
[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