1
votes

When I run a Flex application in the debug flash player I get an exception pop up as soon as something unexpected happened. I would like to catch any exception that can happen anywhere in the Flex code and if it happens don't allow Adobe Debug Flash Player open his pop up window with this exception or error. I tried:

[PostConstruct]
public function init():void
{
   FlexGlobals.topLevelApplication.systemManager.stage.loaderInfo.
   uncaughtErrorEvents.
   addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR,uncaughtErrorHandler);
}

private function uncaughtErrorHandler(event:UncaughtErrorEvent):void
{
    event.preventDefault();
    event.stopImmediatePropagation();
}

but it don't work, general runtime error dialog will still pop up. I tried to prevent this, call event.preventDefault() inside my global error handler, but it don't work to me too. I'm using Flex 4.

1
But why? This is the whole point of a debug player. It will be fine in a regular flash player. - BadFeelingAboutThis
I want that will be fine in a debug flash player. - GSV

1 Answers

0
votes

If you add this line to your mm.cfg file: SuppressDebuggerExceptionDialogs=1 the exception dialogs will not appear any longer. The exception will still be in your flash logs.

http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7fc9.html