When you embed media in FLash Builder like below it creates a class to reference
[Embed(source="images/list.png")]
protected static const LIST_ICON:Class;
What kind of class does that create? And if I had a library swc that contained bitmapData, how would I go about in code creating the same kind of class using a bitmapData from my swc?
I have a SWC with with bitmapData
I have an xml file that comes in my file that defines what bitmap I am using
so I then get the class by doing
var ClassReference:Class = getDefinitionByName("ImageData") as Class;
"ImageData" is example for any text that the xml sends in... so it dynamically decides what swc class to fetch.
Afterwards I need to use this to create a Class that I guess that extends BitmapAsset containing the fetched bitmapData... thus emulating the embed from the first two lines above.
The end result is that I have a system that calls
getQualifiedClassName(SomeClass)
The class this is being passed to then uses
getDefinitionByName("passedName")
to get the Class and thus the containing bitmapData.
Its a bit tricky but I have to do it that way to keep it dynamic on my end... can't modify the code that is handling the data passed to it. It has to be passed by name
I was hoping it would be simpler, but I am starting to think it would be easier to embed all of this in the normal way and make a simple switch that uses a different embed depending on what the XML says