views:

23

answers:

2

Not sure how to phrase this but I'm wondering if I can create a catchall error handler that umbrellas the entirety of the code, to send to a custom handler that outputs the info graphically within the program. Something along the lines of:

root.addEventListener(ErrorEvent.ERROR, this.customHandler); 

I'm hoping to stop any and all from getting to Flash Debug, without placing all of my main code in a TRY/CATCH block. . .

A: 

The keyword for this is "global exception handler" Here is a nice and up to date article about the topic targeting Actionscript:

http://www.rialvalue.com/blog/2010/05/13/global-exception-or-error-handling-in-flex/

softcr
A: 

You can, since flash 10.1, add a global error handler that will trap all error that have not been catch, but you can't get the stack trace into production mode since this one is only available from the debug player.

To add global error handler check this link (>=flash 10.1)

Patrick
>You can, since flash 10.1, add a global error handler that will trap all error that have not been catch, but you can't get the stack trace into production mode since this one is only available from the debug player. So that means that I'll add: stage.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, uncaughtErrorHandler); To what? What I was hoping was to not have to code that into every class, just add the event listener to the highest class on the stack. Like how Windows handles the error stack- it will keep traveling up until something that is listening takes care o it more or less
RutilusHemal
@RutilusHemal Nobody says that you have to put it in all file, just add it into you main swf.
Patrick