在网络错误的Chrome AS3的URLLoader不同的行为错误、不同、行为、网络

2023-09-08 11:58:21 作者:不够洒脱

在Chrome浏览器在网络错误,在错误处理事件对象的行为不同于IE浏览器和Flash播放器(即直接运行SWF,而不是从浏览器)。请看下面的测试code:

In Chrome upon network error, the event object in error handler is behaving differently than IE and flash player (i.e. directly running the swf, not from the browser). Consider the following test code :


private function loadData():void {
    var loader:URLLoader = new URLLoader();
    loader.addEventListener(IOErrorEvent.IO_ERROR, onError);
    loader.addEventListener(Event.COMPLETE, onColmplete);
    loader.load(new URLRequest("http://www.jsfbjdsssde.com"));
    debugField.text = "loading";    // this is a TextField
}

private function onColmplete(evt:Event):void {
    debugField.text = "complete";
}

private function onError(evt:IOErrorEvent):void {
    debugField.text = "error : " + evt.text;
}

在IE浏览器和Flash Player,debugField节目

In IE and flash player, debugField shows

error : Error #2032: Stream Error. URL: http://www.jsfbjdsssde.com

但在Chrome浏览器是

but in Chrome it is

error : Error #2032

这是URL从文本剥离。这是为什么不同?任何人都可以提出任何办法让错误处理程序的网址是什么?或者,这是Chrome浏览器本身?

That is URL is stripped from the text. Why this is different? Anyone can suggest any way to get the URL in error handler? Or is this a bug of Chrome itself?

我的浏览器版本是5.0.375.86

My Chrome version is 5.0.375.86

推荐答案

我没有检查这一点,但它很可能你已经安装在Chrome浏览器的Flash插件(而非调试版本)的发布版本。调试输出在释放玩家更简洁。

I have not checked this, but it's quite likely that you have the release version of the flash plugin installed in Chrome (instead of the debug version). Debugging output is less verbose in the release player.