동일한 도메인의 SWF 파일 두 개를 메인 플래시 플레이어로 차례로로드하려고합니다 ... 첫 번째로드 됨 ... 그것은 잘 작동하지만 다른 하나의 첫 번째 사람의 actionscript freaks (stop() 함수가 작동을 멈춘다)를로드하려고 할 때 또한 두 번째 샌드 박스 위반 (# 2121) .Flash AS3로드 중 2 다른 SWF에서 null 객체 참조 오류가 발생했습니다.
나는이 문제에 대한 이유를 찾을 수없는...
첫 번째 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);
}
두 번째 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");
}
이 오류가 발생합니다.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at SWF1::MainTimeline/frame13()
을 아무도 도울 수있는 코드를 참조하지 않고. – robertp