Hi,
Unfortunately you can't use getDeffinitionByName without the fully
qualified name.
However, you can use class aliases.
Check out the registerClassAlias
<http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/package.html#registerClassAlias%28%29>
and the getClassByAlias
<http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/package.html#getClassByAlias%28%29>
methods in the flash.net package
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/package.html
You can register an alias for all of the classes you'll want to
instantiate at runtime based on their name and then instantiate them
based on the alias you set.
Hope this helps,
Tibor.
www.tiborballai.com
asea19 wrote:
I'm trying to instantiate an object based upon it's name. I don't have
the fully qualified classpath or an instance of the object. I just
have a string representation of the object...i.e "Sprite". Is there
any way to achieve this? The object is available in the .swc I am
including, but I need a way to dynamically instantiate it.
Thanks in advance!