Skip to main content
IGZN
Inspiring
June 5, 2016
Answered

LoaderInfo doesn't catch UncaughtErrorEvent on AIR Mobile

  • June 5, 2016
  • 1 reply
  • 482 views

Hi,

loaderInfo.addEventListener( UncaughtErrorEvent.UNCAUGHT_ERROR, catchThatBastard )

doesn't seem to work in AIR Mobile. I tested it with the latest beta AIR and with 21 too, I just can't get it to work.

It's not functioning in ADL and on actual mobile devices neither.

The first line of catchThatBastard function is trace( 'gotcha' ) and it never appears in the console, instead the debugger window pops up.

It works however in my desktop app which is compiled with the latest production Apache Flex.

Should there be a setting somewhere in the command line or in the application descriptor xml?

What did I do wrong?

Thanks

This topic has been closed for replies.
Correct answer

According to the AS3 docs, the LoaderInfo object doesnt dispatch an UncaughtErrorEvent. There is an "uncaughtErrorEvents" property on the LoaderInfo object that you have to attach the listener to in order to catch those events. Below is the sample from the AS3 documentation.

loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, uncaughtErrorHandler);

LoaderInfo - Adobe ActionScript® 3 (AS3 ) API Reference

1 reply

Correct answer
June 5, 2016

According to the AS3 docs, the LoaderInfo object doesnt dispatch an UncaughtErrorEvent. There is an "uncaughtErrorEvents" property on the LoaderInfo object that you have to attach the listener to in order to catch those events. Below is the sample from the AS3 documentation.

loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, uncaughtErrorHandler);

LoaderInfo - Adobe ActionScript® 3 (AS3 ) API Reference

IGZN
IGZNAuthor
Inspiring
June 5, 2016

Thanks