Hello, I have an AIR application where I have to load a SWF from a server. At some point the user will click on a button and that button will create a new nativeWindow. Inside that nativeWindow we have a stage reference.
I just want to load a SWF, addChild it to the stage and be happy!
But I'm getting this error:
SecurityError: Error #2070: Security sandbox violation: caller http://somewhere.com/swfapp.swf cannot access Stage owned by app:/Teste.swf.
at flash.display::Stage/get stageWidth()
at com.swfapp::MainClass/initApp()
at flash.display::DisplayObjectContainer/addChild()
at flash.display::Stage/addChild()
at NativeWindowSWFLoader/loadSWFURLComplete()[C:\Users\hats\Desktop\teste\NativeWindowSWFLoader.as:93]
I'm using a normal SWFLoader:
private function loadSWF(url:String):void
{
holder = new MovieClip();
applicationDomain = new ApplicationDomain();
loaderContext = new LoaderContext(false, applicationDomain);
loader = new SWFLoader(url, { context:loaderContext, container:holder, onProgress:progressHandler, onComplete:onCompleteSWFLoader } );
loader.load();
}
private function onCompleteSWFLoader(e:Event):void
{
this.stage.addChild(holder);
}
Can someone hep me on this? Thank you.