CS3 Flash-错误#2044:未处理的IOErrorEvent :. text =错误#2035:找不到URL [英] CS3 Flash - Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found

查看:184
本文介绍了CS3 Flash-错误#2044:未处理的IOErrorEvent :. text =错误#2035:找不到URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.swf文件位于我的媒体库和硬盘中,为什么会说找不到它们?

The .swf files are in my library and on my hard drive, why is it saying it can't find them?

import flash.display.Loader;
import flash.events.MouseEvent;
import flash.net.URLRequest;

var myLoader:Loader=new Loader();
myLoader.x = 0;
myLoader.y = 100;

btn1.addEventListener(MouseEvent.CLICK, movie1);
function movie1(myevent:MouseEvent):void{
    var myURL:URLRequest=new URLRequest("Phase1IP.swf");
    myLoader.load(myURL);
    addChild(myLoader);
}

btn2.addEventListener(MouseEvent.CLICK, movie2);
function movie2(myevent:MouseEvent):void{
    var myURL:URLRequest=new URLRequest("Phase2IP.swf");
    myLoader.load(myURL);
    addChild(myLoader);
}


btn3.addEventListener(MouseEvent.CLICK, movie3);
function movie3(myevent:MouseEvent):void{
    var myURL:URLRequest=new URLRequest("Phase3IP.swf");
    myLoader.load(myURL);
    addChild(myLoader);
}

推荐答案

尝试将事件侦听器添加到您的myLoader中以捕获IO错误.在下面的示例(不应在生产环境中使用)中,我将简单地将ActionScript认为丢失的文件的完整URL跟踪到控制台...

Try adding an event listener to your myLoader to catch IO errors. In the following example (which should not be used in Production) I'll simply trace the full URL of the file that ActionScript thinks is missing to the console...

var myLoader:Loader=new Loader();
myLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function(ioError:IOErrorEvent){
  trace(ioError.text);
});

现在,当您单击按钮时,您的控制台应显示类似...

Now, when you click on your button, your console should display something like...

Error #2035: URL Not Found. URL: file:///C|/.../Phase1IP.swf

如果您确定Phase1IP.swf位于无法加载 的控制台的URL上,则可能还有另一个问题需要探讨.

If you determine that Phase1IP.swf is located at the URL traced to the console it still won't load, there may be another issue to explore.

这篇关于CS3 Flash-错误#2044:未处理的IOErrorEvent :. text =错误#2035:找不到URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆