actionscript-3 - 在 ActionScript 3中,当UncaughtErrorEvent发生时停止我的Flash应用程序是否安全?

标签 actionscript-3 actionscript exception-handling error-handling

发生意外异常时
我想删除所有DisplayObject并显示错误消息,以告诉用户程序已崩溃。

使用UncaughtErrorEvent这样做安全吗?
即使我使用UncaughtErrorEvent来停止应用程序也可以停止它吗?

最佳答案

当然可以。

root.loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, onUncaughtError);

private function onUncaughtError(e:UncaughtErrorEvent):void
{
    // Do something with your error.
}

但是请注意,我相信这是Flash Player 10.1及更高版本的功能。这应该不是大问题,因为通常每当发布新的Flash Player版本时,人们就不得不进行更新。

关于actionscript-3 - 在 ActionScript 3中,当UncaughtErrorEvent发生时停止我的Flash应用程序是否安全?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7495128/

相关文章:

actionscript-3 - 错误 2006 提供的索引超出范围

flash - AS3 : Analyzing sound spectrums one by one, 一次一个 channel

html - 如何使 Flash 动画具有响应性

android - 如何检测 Adob​​e AIR 中的 Android 操作系统版本?

flash as3 使用 curveTo 绘制一个 donut 楔形(具有内外半径的圆弧)

c# - Entity Framework ORDER BY 问题

actionscript-3 - as3 为舞台上的动态文本数字添加逗号

actionscript-3 - AS3 层之间的变量和响应

java - gui 应用程序中的异常处理

c# - 异常处理 - catch 子句中的异常?