I am trying to load external swf file into my AIR application and of course AIR gives me security violation exception.
Now I am trying to find workaround in more hackable way, first load swf with Loader
, set
var context:LoaderContext = new LoaderContext();
context.allowCodeImport = true;
and then convert my Loader
into SWFLoader
.
Here is the complete example:
var _loader:Loader = new Loader();
var context:LoaderContext = new LoaderContext();
context.allowCodeImport = true;
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
_loaderload(new URLRequest("Y:/dev/Pdf2SwfProj/fscommand/pdfurl-guide.swf"), context);
public function loadComplete(event:Event):void
{
// This is the part I am intrested in, how to convert data loaded into SWFLoader ?
var swfLaoder : SWFLoader = SWFLoader(event.target);
}
Thank you.