Flash Builder 4.x debugging tips | Mana Blog... for all
May 18, 2011

The following tips are useful to know and remember while in a debugging session. Some of them are actually new in Flash Builder 4 and definitely worth knowing.

Conditional breakpoints - You can now set a condition on a breakpoint that will cause it to only fire a certain number of times, or based on a certain expression or boolean (for instance it will only halt at that breakpoint when a given variable is a certain value). To set a conditional breakpoint, first set a breakpoint on a line (Shift-Cmd-B), then right-click and select Breakpoint Properties. You can set multiple expressions and just separate them with a comma or even modify a line of code from here without recompiling. Watch this Adobe TV video for some interesting things you can do with this feature.

Watchpoints - New to Flash Builder 4, it allows you to monitor a variable instance during a debugging session. To use a watchpoint you need to set a breakpoint and when it stops at the breakpoint, go to the variables view and right click on the variable instance to toggle a watchpoint. You can find more information about how to debug with watchpoints in this article.

Expressions - You can actually drag any expression into this dialog box directly from your code to quickly monitor that expression. Note that if you are in the editor dialog box for the Expression you can type Shift-Enter to close it quickly rather than go to a newline.

Run to Line - Cmd-R - While in a debug session and stopped at a breakpoint, you can choose a line further in the code to run to by going to it and doing Cmd-R or right-click and find Run to Line in the context menu to continue to run to that specific line of code.

Network Monitoring - New to Flash Builder 4 it allows you to inspect and monitor network traffic from your Flex/AIR applications that use HTTPService, WebService, RemoteObject, URLRequest, etc. It can be used to examine XML, AMF, and JSON data sent using SOAP, AMF, HTTP, and HTTPS protocols. Note: this feature requires Flash Builder Premium and does not work with SSL or Data Management services provided by LiveCycle Data Services.

0 comments: