【问题标题】:Error #2032 while loading "http://web.archive.org" through URLLoader通过 URLLoader 加载“http://web.archive.org”时出现错误 #2032
【发布时间】:2011-01-15 11:03:42
【问题描述】:

这是我在 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:. text=错误 #2032

【问题讨论】:

  • 您应该修改问题以包含更多详细信息。这是编译时错误还是运行时错误?您是在 AIR 应用程序中还是在浏览器中运行?您无法在浏览器中加载 archive.org 文件 b/c 没有 crossdomain.xml 文件。

标签: apache-flex actionscript-3 air flexbuilder


【解决方案1】:

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

【讨论】:

    【解决方案2】:

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

    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.
        \************************************************************/
    }
    

    【讨论】:

    • 网址中的星号非常好 - 它只是返回一个不同的页面。
    【解决方案3】:

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

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

    【讨论】:

      猜你喜欢
      • 2016-10-14
      • 1970-01-01
      • 2018-01-09
      • 1970-01-01
      • 2015-05-26
      • 1970-01-01
      • 2012-03-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多