88
Chapter 3: Creating, Coding, and Debugging Flex Files
The debugger will only stop at breakpoints set on lines containing the following:
•
MXML tags containing an ActionScript event handler, such as
<mx:Button
click="dofunction()" ...>
•
ActionScript lines such as those enclosed in an
<mx:Script>
tag or in an AS file
Before you start, make sure you correctly defined a Flex testing server for Flex Builder, and that
the server is running. Flex Builder relies on the testing server to compile ActionScript and to
obtain information about the state of the application. For more information, see
“Starting a new
application in Flex Builder” on page 9
.
Note:
To use the ActionScript debugger, the debug version of Flash player is required. Flex Builder
installs this version, but it can be overwritten if you install a new version of the player or if you install
another Macromedia product such as Breeze. To reinstall the debug version of the player, see the
Release Notes on the Macromedia website at
www.macromedia.com/go/fb_releasenotes/
.
The following table provides a quick debugging reference, followed by more detailed information:
To debug ActionScript:
1.
Set one or more breakpoints by doing one of the following in Code view:
■
Control-click in the gutter beside the ActionScript line where you want the script to stop
executing.
■
Click anywhere inside the line of code and press Alt+B.
■
Click anywhere inside the line of code and select Edit > Set Breakpoint.
■
Right-click anywhere inside the line of code and select Set Breakpoint from the context
menu.
A small dot representing the breakpoint appears in the gutter beside the line.
Note:
Before you can set breakpoints in a file in Code view, the file must exist on the hard disk.
Save the file before setting breakpoints.
To remove one or more breakpoints, do one of the following:
■
To remove one breakpoint, Control-click the breakpoint in the gutter of the file.
■
To remove all breakpoints in the file, select Edit > Remove All Breakpoints in File.
■
To remove all breakpoints in internal files, select Edit > Remove All Internal Breakpoints.
Tip:
You can also right-click the file and select the Edit options in the context menu that appears.
To do the following task...
Perform this action
Set a breakpoint
In Code view, Control-click the file’s gutter next to the
line of ActionScript where you want to stop.
Start the debugger
Click the Debug button on the Document toolbar or
press Alt+F6.
Step through the ActionScript
Click the Continue, Step In, Step Out, and Step Over
buttons on the debugging toolbar.
Stop the debugger
Click Stop on the debugging toolbar.
Remove a breakpoint
In Code view, click the breakpoint in the gutter of the file.
Summary of Contents for FLEX BUILDER-USING FLEX BUILDER
Page 1: ...Using Flex Builder...
Page 116: ...116 Chapter 4 Building a Flex User Interface Visually...
Page 144: ...144 Chapter 6 Working with Data...
Page 154: ...154 Appendix A Basic Flex Concepts...