I am loading a swf into another swf using swfloader, I want to catch all the exceptions thrown by the inner swf, is it doable?
相关问题
- how to call a C++ dll from C# windows application
- Should I wait for Flash Player 10.1 or go with Fla
- How to load flex swf from flash?
- Catch the same exception twice
- Create CFrameWnd gives first-chance exceptions--wh
相关文章
- JUnit continue to assert things after expected exc
- How to handle translation of exception message?
- correct way to store an exception in a variable
- UnhandledException Event doesn't work?
- Any way in Visual Studio to not break on throwing
- C++ (Standard) Exceptions and Unicode
- What's the significance of -532459699?
- What specifically causes EPrivilege to be raised?
Here are some basics that may help. In short, you cannot use try/catch here.
Errors in loading external content cannot be caught with try..catch..finally statements. Instead you have to create event handlers to handle and “catch” the error events. If you do not have an event listener assigned to an error event and that error occurs, the Flash player will inform you of the unhandled error event.
If you want to invoke your own asynchronous errors, all you need to do is dispatch an event using dispatchEvent that is of the type ErrorEvent. When an unhandled ErrorEvent reaches the Flash player when authoring in Flash, the output window will display the error.
As of Flash 10.1 it is now possible to catch all errors thrown by both the main swf and any swfs loaded inside of it.
To do this you need to listen for an UncaughtErrorEvent dispatched from the
loaderInfo.uncaughtErrorEvents
object, like so:Please use with caution, as this will suppress all errors from being shown by the debug version of the player, and the flashlog.txt.