gpt4 book ai didi

actionscript-3 - 如何修复错误 : Error #2044: Unhandled IOErrorEvent:. text=Error #2035:找不到 URL

转载 作者:行者123 更新时间:2023-12-04 06:48:57 25 4
gpt4 key购买 nike

我使用代码但出现错误

msg: Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.

var myLoader:Loader = new Loader();
addChild(myLoader);
var url:URLRequest = new URLRequest("gallery/test.swf");
myLoader.load(url);

如何解决这个问题?

最佳答案

必须添加监听器

var context:LoaderContext = new LoaderContext();
context.checkPolicyFile = true;

var url:URLRequest = new URLRequest("gallery/test.swf");

var myLoader:Loader = new Loader();
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
myLoader.addEventListener(AsyncErrorEvent.ASYNC_ERROR, errorHandlerAsyncErrorEvent);
myLoader.addEventListener(IOErrorEvent.IO_ERROR, errorHandlerIOErrorEvent);
myLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandlerSecurityErrorEvent);
myLoader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
myLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, infoIOErrorEvent);
myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressListener);

myLoader.load( url,context );
myLoader.load( url);



function progressListener (e:ProgressEvent):void{
trace("Downloaded " + e.bytesLoaded + " out of " + e.bytesTotal + " bytes");
}
function initHandler( e:Event ):void{
trace( 'load init' );
}
function errorHandlerErrorEvent( e:ErrorEvent ):void{
trace( 'errorHandlerErrorEvent ' + e.toString() );
}
function infoIOErrorEvent( e:IOErrorEvent ):void{
trace( 'infoIOErrorEvent ' + e.toString() );
}
function errorHandlerIOErrorEvent( e:IOErrorEvent ):void{
trace( 'errorHandlerIOErrorEvent ' + e.toString() );
}
function errorHandlerAsyncErrorEvent( e:AsyncErrorEvent ) :void{
trace( 'errorHandlerAsyncErrorEvent ' + e.toString() );
}
function errorHandlerSecurityErrorEvent( e:SecurityErrorEvent ):void{
trace( 'errorHandlerSecurityErrorEvent ' + e.toString(
) );
}
function onLoadComplete( e:Event ):void{
trace( 'onLoadComplete' );
}

关于actionscript-3 - 如何修复错误 : Error #2044: Unhandled IOErrorEvent:. text=Error #2035:找不到 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6130609/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com