Conditionally enter Debugger in Flex 2
- Posted at 2007/09/05 15:09
- Filed under Development Tip
- Tag
- Flex
While coding in Flex Builder 2 I found an interesting code hint for a enterDebugger():void
method. This seemed to be another undocumented goodie so I gave it a
try - and it really works. By using the enterDebugger() method in your
code you can invoke the Debugger without setting any breakpoints in
your code. Just place the method call where you want to enter the
Debugger and it will stop at that very line
Here’s a quick example:
var n:Number = Math.random();
if (n > 0.9)
{
enterDebugger();
}
This
allows you to write pretty nice dynamic debug code - of course you need
to have the Debug version of Flash Player 9 to get this working. I
haven’t tested yet what happens if the enterDebugger() gets called in
the Release version but I suspect it is just ignored silently.
Original post by Richinternet Blog and software by Elliott Back
Posted by XO
- Response
- No Trackback , No Comment
Trackback URL : http://taez.net/blog/trackback/36


