Skip to main content
Participating Frequently
August 15, 2013
공지사항

UncaughtErrorEvents never dispatched on SWFs loaded from the local file system on Android

  • August 15, 2013
  • 3 답변들
  • 659 조회

We have an AIR mobile app that we build for iOS and for Android. Some weeks back, we modified the Android version to use a small preloader SWF to display a splash screen while the main app SWF loads - this considerably reduced the time between app launch and seeing something on the screen, which was unacceptably long before. So far, so good - except that we also had a handler for uncaught errors that would pop up an alert describing the error and telling the user to kill and restart the app. Ideally there would be no uncaught errors, but at least this way, users that actually know how to kill an app on their phones could continue using the app, and/or report a bug to us with a meaningful error message.

The main (loaded) SWF is packaged with the app in the APK, and I've tried adding event listeners to all the objects and event phases specified in the documentation for UncaughtErrorEvent:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/UncaughtErrorEvent.html

The error handler is never triggered. It was working fine before the change to use a preloader SWF. Any help would be appreciated.

이 주제는 답변이 닫혔습니다.

3 답변

chris.campbell
Legend
August 16, 2013

Any chance you could share a sample project with us that illustrates the problem?  If you'd like to keep this private, feel free to email the attachment to me directly (ccampbel@adobe.com) and I can forward it along to the team.

I'd also recommend crossposting in the AIR development forum (http://forums.adobe.com/community/air/development) to see if anyone there has encountered this behavior before.

Thanks,

Chris

panicolai작성자
Participating Frequently
August 19, 2013

Unfortunately, when I do a test project only containing a preloader and a swf that just throws an uncaught error, everything works fine - that means it's something a lot stranger inside the Flash player, which I don't have access to what I would need to debug it. And I'm not allowed to send you the code even privately. When I package the app without the preloader, everything works fine (except startup time of course).

panicolai작성자
Participating Frequently
August 20, 2013

OK - there is something strange going on with our app, because even though I was careful to use the exact same loading code for the SWF in the example, it's behaving differently from the example. For example, the display objects in the loaded SWF think their "root" property is an instance of Stage - at least according to the debugger - so it may be that they don't have access to the right LoaderInfo object. Moving the code that adds the event listener into the main app class worked.