Embedded Bitmap Name Appends Class name
Hi.
i have this class:
package {
import flash.display.Sprite;
[SWF(width = "1024", height = "768", backgroundColor = "#000000", frameRate = "30")]
public class myclass extends Sprite {
[Embed(source="myimage.png", mimeType="image/png")] public var myimage:Class;
}
}
I compile the image directly into swf with mxmlc compiler. After i load the swf in a main application i can't retrieve it with the name "myimage" but have to use "myclass_myimage" instead....
var id:String = "myclass_myimage";
var ref:Class = loader.contentLoaderInfo.applicationDomain.getDefinition(id) as Class;
var img:Bitmap = new ref() as Bitmap;
How can i specify that i want it to be compiled with "myimage" and not "myclass_myimage"? or is there another way to retrieve the image using "myimage"?
Cheers,
Harry