I have Main.fla and SkinA.fla. Both have MovieClip library item: MC_BrandLogo.
I'm loading the SkinA.swf into Main.swf in the current application domain trying to replace the class inside Main.swf. If there is no library item in the Main.fla, I can instantiate MC_BrandLogo with the correct graphic. If the MC_BrandLogo already exist in the Main.fla then that graphic is used even though I loaded new one in the current application domain.
Is there a way to replace existing linked movie clips with loaded dynamically?
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onSkinLoaded);
var context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);
loader.load(new URLRequest("SkinA.swf"));
function onSkinLoaded(e:Event):void {
trace("loaded Skin");
addChild(new MC_BrandLogo());
}
EDITED: There is no way to override the images I was trying to override, because this is how application domains work. If the definitions exist in the parent application domain, they are used.
As far as I know you can not overwrite a Class Definition in an ApplicationDomain unless you wish to resort to manipulating bytecode at runtime.
What you can do, however, is load your skin SWF into a child Application Domain and then retrieve the appropriate Class Definition (symbol) via ApplicationDomain.getDefinition; ie:
To help debug missing symbol names in ApplicaitonDomains you can list all Class Definitions (symbols) contained by using SWF Explorer.