views:

92

answers:

2

Hi,

I am developing a Flex + AIR application. While debugging using Flash Builder sometimes I get runtime errors dialog with 'continue' & 'dismiss all' buttons. But when I release a build(.air) & run the application after installing. Then I don't get the same dialog in the release build.

I need to track these types of runtime errors for that I am trying to write them to a file as logs.

I tried using try catch & writing to file in catch block, but I am not able to get any wayout for unhandled exceptions or runtime errors.

Is there any way to achieve it?

Thanks in advance.

A: 

The error dialog is displayed only if you use the debugger version of Flash Player.

You could register an UncaughtErrorEvent handler and log the errors with trace or with the logging API:

private function onApplicationComplete():void
{
    loaderInfo.uncaughtErrorEvents.addEventListener(
        UncaughtErrorEvent.UNCAUGHT_ERROR, onUncaughtError);
}

private function onUncaughtError(event:UncaughtErrorEvent):void
{
    trace(error);
}
splash
gauravgr8
Flash Player 10.1 or AIR 2 is required.
splash
A: 

You can't debug compiled AIR application with the Flash debug player because the debug information is removed when you make a release build. You can use something like De MonsterDebugger to output error information, but generally it's a bad idea to show error info in a release build. You should be testing prior to releasing.

Inigoesdr