Hi Julian,

A simple question perhaps but couldn't figure it out by myself.
How can I instantiate a class having it's qname? Say I know that I need an instance of "org.foo.Bar", how can I summon it?

I tried doing:

 var anObject = new (eval("org.foo.Bar"));

but I get undefined in return. Maybe there is someobscure method like Class.instantiate(aQname) that I overlooked?

Your example should work. Are you sure that the class has been compiled into your SWF? If there's nothing that absolutely references your class in the code, it won't get compiled in. You can test that by tracing the value of _global.org.foo.Bar.

Cheers,

Steve

--
Steve Webster
Head of Development

Featurecreep Ltd.
http://www.featurecreep.com
14 Orchard Street, Bristol, BS1 5EH
0117 905 5047


_______________________________________________
[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