views:

576

answers:

1

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

A: 

Did you try just loading the swf and when it's completely loaded, getDefinition(class)? No Embeds

wasim
Yes and it works as I have described above, but I'm trying to avoid having to load in a bunch of individual swfs. Using the flex compiler it would be possible to have it embed several swfs into one and it could be managed by a server-side script to update and recompile the library when necessary.
Xyre