보이지 않는 오류를 잡으려면 표준 try-catch 블록을 사용할 수 있습니다. 오류 # 2180 - 당신이로드하려는 SWF는 (AS2로 게시) 오래된 SWF는 같은
var ldr:Loader = new Loader();
ldr.contentLoaderInfo.addEventListener("complete", ldrDone);
ldr.contentLoaderInfo.addEventListener("ioError", ldrError);
ldr.load(new URLRequest("FILE-NAME-COMES-HERE"));
function ldrDone(evt:*):void
{
//if the file can be loaded into a Loader object, this part runs
var temp:*;
try
{
temp = evt.target.content;
//add it to the stage
stage.addChild(temp);
//this traces whether the loaded content is a Bitmap (jpg, gif, png) or a MovieClip (swf)
var classOfObject:String = flash.utils.getQualifiedClassName(temp);
trace(classOfObject);
}
catch(error:*)
{
trace("some error was caught, for example swf is AS2, or whatever, like Error #2180");
}
}
function ldrError(evt:*):void
{
//if the file can't be loaded into a Loader object, this part runs
trace("this is the error part, Error #2124 won't show up");
}
이 오류를 잡는다.
파일을 찾을 수 없거나로드 가능한 형식으로 보이지 않는 경우 ioError 부분이 실행됩니다 (오류 # 2124).
onIO 오류 수신기 기능이 있습니까? URLLoader를 사용하고 있습니까? – DanielB
yes onIOError 함수를 만들었습니다. 예, URLLoader를 사용하고 있습니다. 이미지를로드 할 때 제대로 작동하지만 손상된 이미지를 사용할 때 오류를 처리 할 수 없습니다. – JustMe
httpStream : http : //help.adobe를 사용하십시오. com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLStream.html – www0z0k