小编hoo*_*ooh的帖子

ActionScript编译器UncaughtErrorEvent

使用asc2编译AIR应用程序后,我发现在捕获UncaughtErrorEvent时缺少错误堆栈跟踪.

这是示例代码:

var root:Sprite = this;
root.loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR,errorHandle);
throw new Error("test");

protected function errorHandle(event:UncaughtErrorEvent):void
        {
            var message:String; 
            if (event.error is Error) { 
                message = Error(event.error).message; 
                message+="\n"+Error(event.error).getStackTrace();
            } else if (event.error is ErrorEvent) { 
                message = ErrorEvent(event.error).text;
            } else { 
                message = event.error.toString(); 
            } 
        }
Run Code Online (Sandbox Code Playgroud)

在使用ASC1时,我可以在错误句柄中看到完整的堆栈跟踪.但是使用ASC2,只是一个空堆栈跟踪.

有人有同样的问题吗?

你如何获得UncaughtErrorEvent堆栈跟踪?

air flash actionscript-3

3
推荐指数
1
解决办法
1922
查看次数

标签 统计

actionscript-3 ×1

air ×1

flash ×1