views:

41

answers:

2

I'd like to be able to redirect the traces, and even more then traces the flash error reports to a text-box inside my flash app, so I can see the bug report in a computer that doesn't have flash-player debugger version or flashbug installed.

Any error message that comes on in my app should show in this textbox.

How can I do this?

+1  A: 

For traces, you can try to declare your own trace function, which will accumulate messages and show them when some key is pressed. For exceptions, they must be caught and traced. In AIR, there is global exception handler, but not in Flash.

alxx
+1  A: 

Create your own error reporting class with a simple TextField and an event listener which will update your TextField content by returning the text property of a custom event or a Signal you would dispatch , wherever you need to add a trace statement in your application.

For simplicity's sake and since this is only used as a development tool , create a Singleton whose sole purpose will be to dispatch & receive events.

Edit: Re: a global error handler, you could have a look at this , but it seems that it's still in beta http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/events/UncaughtErrorEvent.html

PatrickS