Macromedia flex builder-using flex builder User Manual

Page of 158
Testing and debugging Flex files
89
2.
If you want, enter one or more traces in the ActionScript and set a breakpoint on the line 
immediately following the trace.
For example, you might enter the following trace (shown in bold type) in your ActionScript 
file:
5 ...
6 function myFunc()
7 {
8
trace("Inside my function");
9
btn.label="OK";
10 }
11 ...
If you set a breakpoint at line 9 (
btn.label="OK";
) and start the debugger, the Output panel 
should display the item “Inside my function” when Flex Builder stops at the breakpoint.
3.
Switch to the project’s application file (the file with the 
<mx:Application>
 root tag) and start 
the debugger by doing one of the following:
Press Alt+F6.
On the Document toolbar, click the Debug button.
Select File > Debug.
Select File > Debug in Browser, and select a browser.
On the Output panel in the Results panel group (Window > Results), click the Play button 
on the sidebar and select Debug > Debug in Flex Builder.
On the Network Monitor panel in the Results panel group (Window > Results), click the 
Play button on the sidebar and select Debug > Debug in Flex Builder.
A dialog box appears asking you if you want to upload dependent files. Dependent files include 
any ActionScript file, MXML file, or image file referenced in the file. 
If copies of dependent files such as images or other files are not already located on the testing 
server, select Yes in the Dependent Files dialog box.
Flex Builder will upload most dependent files to the testing server. The server compiles the 
MXML application file using the files on the server. If a dependent file is missing, then the 
application file may not compile or may not run properly.
Note: Flex Builder may not upload all dependent files. For more information, see 
.
The Flex server attempts to build the project. If the build is successful, Flex Builder switches to 
debug mode and the ActionScript executes up to the first breakpoint and stops. If you set a 
breakpoint in an event handler, you must trigger the event in the application to reach the 
breakpoint.
After reaching a breakpoint, Code view becomes read-only and debugging information appears 
in some of the Results panels.