FlashDevelop에서 생성 된 AS3 프로젝트입니다. 그것은이 코드를 실행할 때 나는 불안 문제가 10 플래시 플레이어 대상 : 이제외부 swf를로드 할 때 플래시 크래시가 발생합니다 (코드 예는 이번에 사용)
package
{
import flash.display.Loader;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLRequest;
public class Main extends MovieClip
{
private var loader:Loader;
private var sprite:Sprite;
public function Main():void
{
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init); }
private function init(e:Event = null):void {
removeEventListener(Event.ADDED_TO_STAGE, init);
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadingDone);
loader.load(new URLRequest('loadIn.swf')); // error occurs when loading this file.
//loadIn.swf is compiled with all the code in this file but with the loader-parts commented out...
// just a Adobe Flash created graphic, no problems loading this one
//loader.load(new URLRequest('waitingPopup.swf'));
//sprite = new Sprite();
//sprite.graphics.beginFill(0xFF0000);
//sprite.graphics.drawRect(0, 0, 490, 356);
//sprite.graphics.endFill();
//addChild(sprite);
}
private function loadingDone(e:Event):void {
trace(loader.contentLoaderInfo.contentType); // application/x-shockwave-flash
trace(loader.contentLoaderInfo.parentAllowsChild); // true
trace(loader.contentLoaderInfo.sameDomain); // true
trace(loader.contentLoaderInfo.swfVersion); // 10
trace(loader.contentLoaderInfo.content); // [Object Main]
//this is were everything goes south
addChild(e.target.content);
}
}
}
를, 내가 디버그 창에서 수집 할 수 있는지, 무슨 일하면 SWF 자체를 다시 시작 단지 루프에서 끝나는 것입니다 addChild()
-method를 호출하려고합니다. 내 출력 창에 표시된 모든 것입니다 :
[SWF] C:\svn\Development\TestProject\bin\loadIn.swf - 1 797 bytes after decompression.
application/x-shockwave-flash
true
true
10
[object Main]
어떤 이상한 루프와 오류를 만들 수있는 아이디어? 나는 그것을 하루 종일 풀려고 노력했다. 어쩌면 FlashDevelop의 설정이나 MXMLC 컴파일러의 매개 변수일까요?
모든 대답에 감사드립니다!
thanks alot! 내 문제를 해결! 내가로드 된 swf와 메인 swf 사이의 네임 스페이스 충돌이 꽤 있었기 때문에 플래시가 너무 민감하다는 것을 전혀 알지 못했습니다. 나는 이상한 것을 발견했다. 메인 클래스가 메인 swf와 같은 이름을 가진 파일을로드 할 때 오류가 발생하지 않는다. (내 생각에) 메인 swf => 루프의 메인 클래스를 호출한다.) 다시 한 번 감사드립니다! – Tobias
듣기 좋다! =) – DHuntrods