捕捉Flash的全局错误

新版的Flash 10.1 开始支持全局错误捕捉事件了!

 

代码:

loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, onUncaughtError); function onUncaughtError(e:UncaughtErrorEvent):void { // Do something with your error. if (e.error is Error) { var error:Error = e.error as Error; trace(error.errorID, error.name, error.message); } else { var errorEvent:ErrorEvent = e.error as ErrorEvent; trace(errorEvent.errorID); } }

 

http://blogs.adobe.com/cantrell/archives/2009/10/global_error_handling_in_air_20.html

你可能感兴趣的:(捕捉Flash的全局错误)