加载“http://web.archive.org”时出现错误#2032通过 URLLoader

发布于 2024-10-12 07:19:16 字数 407 浏览 3 评论 0原文

这是我在AS3中的代码

var request:URLRequest = new URLRequest("http://web.archive.org/web/*/http://stackoverflow.com");
var requestVars:URLVariables = new URLVariables();
var loader:URLLoader = new URLLoader();

request.method = URLRequestMethod.GET;
loader.addEventListener(Event.COMPLETE, onLoaded);

loader.load(request);

...... ...

错误详细信息: 未处理的 ioError:.文本=错误#2032

Here is my code in AS3 ...

var request:URLRequest = new URLRequest("http://web.archive.org/web/*/http://stackoverflow.com");
var requestVars:URLVariables = new URLVariables();
var loader:URLLoader = new URLLoader();

request.method = URLRequestMethod.GET;
loader.addEventListener(Event.COMPLETE, onLoaded);

loader.load(request);

...
...

Error Detail :
Unhandled ioError:. text=Error #2032

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

晨与橙与城 2024-10-19 07:19:16

我建议下载 FiddlerCharles 并使用它来确定服务器响应是什么。

I recommend downloading Fiddler or Charles and using that to determine what the server response was.

冰之心 2024-10-19 07:19:16

您遇到的一个问题是没有创建 onLoaded 函数 - 至少在上面的文档中是这样。我还注意到您的网址中有一个*。我将其替换为链接 20080703183923 之一,该链接返回 Flash 中的 HTML 页面以供使用。这是获取 Flash 中信息的代码 ->

var request:URLRequest = new URLRequest("http://web.archive.org/web/20080703183923/http://stackoverflow.com");
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onLoaded);
loader.load(request);

function onLoaded(event:Event):void
{
    trace(event.target.data);
    /************************************************************\ 
        returns the HTML printed out in the Flash Output. 
        You could then do whatever it is you want with it.
    \************************************************************/
}

One issue you have is that there isn't a onLoaded function created - at least in your documentation above. I also noticed that you had an * in the url. I replaced that with one of the links 20080703183923 which returns a HTML page in flash to use. Here is the code to grab the info in flash ->

var request:URLRequest = new URLRequest("http://web.archive.org/web/20080703183923/http://stackoverflow.com");
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onLoaded);
loader.load(request);

function onLoaded(event:Event):void
{
    trace(event.target.data);
    /************************************************************\ 
        returns the HTML printed out in the Flash Output. 
        You could then do whatever it is you want with it.
    \************************************************************/
}
倾城花音 2024-10-19 07:19:16

我试图重现你的问题。这是我发现的:

  1. 错误 2032 是流错误,这意味着无法加载文件。
  2. 您应该始终添加一个事件处理程序来捕获 IOErrorEvent.IO_ERROR。您可以使用 error.getStackTrace()error.message 以了解有关错误发生原因的更多信息。
  3. 您无法从 web.archive.org 下载任何资源,因为它似乎不提供 crossdomain.xml 策略文件。 Flash 的安全性可防止您从未明确允许您的域访问的远程服务器下载 URL。这可能是您的页面请求失败的原因。

I tried to reproduce your problem. Here is what I found:

  1. Error 2032 is a Stream Error, which means the file could not be loaded.
  2. You should add always add an event handler to catch IOErrorEvent.IO_ERROR. You could use error.getStackTrace() or error.message to find out more about why the error occured.
  3. You cannot download any resources from web.archive.org, because it doesn't seem to serve a crossdomain.xml policy file. Security in Flash prevents you from downloading a URL from a remote server which does not explicitly allow your domain to access it. This is probably the reason for your page request to fail.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文