Flex SWF assets loaded into Flash SWF at runtime within same ApplicationDomain
Posted
by Xyre
on Stack Overflow
See other posts from Stack Overflow
or by Xyre
Published on 2009-12-01T23:51:18Z
Indexed on
2010/04/17
4:03 UTC
Read the original article
Hit count: 333
I'm trying to load a swf compiled by the Flex SDK into a swf exported by the Flash IDE and instantiate the assets by way of getDefinition(). Normally this works fine with assets exported from the Flash IDE then loaded into another swf also from Flash IDE.
This is how I could normally do this using only the Flash IDE:
Loader - > Using same ApplicationDomain - > getDefinition(class)
Now, using the 'Test.as' compiled from Flex SDK using the [Embed] metadata tag:
Loader - > Using same ApplicationDomain - > getDefinition("Test_" + class)
The problem is I'd rather not have to keep track of the asset libraries loaded to prefix the class name I'd like to get (('Test_" + class) vs (class)). Is there any way of doing this without referencing the library the class is being pulled from or without accessing the original loader? This way I don't need to know which swf the asset is coming from, just the class name that I could instantiate from the current ApplicaitonDomain.
Thanks
© Stack Overflow or respective owner