Conditionally enter Debugger in Flex 2

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

크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by XO


Trackback URL : http://taez.net/blog/trackback/36

Leave a comment
« Previous : 1 : ... 54 : 55 : 56 : 57 : 58 : 59 : 60 : 61 : 62 : ... 90 : Next »

Popular articles

Calendar

«   2010/09   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Statistics Graph