I'm trying to load two swf files one after the other from the same domain into a main flash player... When The first one is Loaded... it works fine, But when I'm trying to load the other one the first one's actionscript freaks out (stop() function just stops working) In addition, the second one doing some issues with sandbox violation (#2121).
I don't find a reason for this problem...
The Loading code for the first swf:
...
ldr = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded);
ldr.load(new URLRequest(swf1filename));
...
function swfLoaded(e:Event):void {
mcExt = MovieClip(e.currentTarget.content);
mcExt.x = 0;
mcExt.y = 32;
addChild(mcExt);
}
The Loading code for the second swf:
...
function showSWF2(){
if ( end_movie_swf == null && endMcExt== null ){
end_movie_swf = new Loader();
end_movie_swf.contentLoaderInfo.addEventListener(Event.COMPLETE, Swf2Loaded);
end_movie_swf.load(new URLRequest(endSwffilename));
}else{
endMcExt.gotoAndPlay("show");
}
}
...
function Swf2Loaded(e:Event):void {
trace(e);
endMcExt = MovieClip(e.currentTarget.content);
end_movie_swf.contentLoaderInfo.removeEventListener(Event.COMPLETE, endSwfLoaded);
endMcExt.x = 0;
endMcExt.y = 0;
addChildAt(endMcExt,3);
endMcExt.gotoAndStop("show");
}
and I'm getting this error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at SWF1::MainTimeline/frame13()