Usually we load external swf file into Flash using ‘Loader’ class.
var loader:Loader = new Loader();
loader.load(new URLRequest("http://domain/path/my-external-swf.swf"));
However, the external swf file is now embedded in my flash document:
[Embed("my-external-swf.swf")]
public var component:Class;
Is it possible to tell ‘Loader’ to load from embedded content instead?
You should be able to simply do this:
Hopefully the name
componentwon’t collide with any reserved variables.If you still would like to use the Loader class, as @Lukasz advises, use the loadBytes() method and pass the embedded asset. If your swf also contains code, you might need to initialize the LoaderContext: