A breakpoint lets you stop a Flash application at a specific line of ActionScript. You can use breakpoints to test possible trouble spots in your code. For example, if you’ve written a set of if..else if statements and can’t determine which one is executing, you can add a breakpoint before the statements and examine them one by one (step through them) in the Debugger.
You can set breakpoints in the Actions panel, Script window, or Debugger. Breakpoints set in the Actions panel are saved with the FLA file. Breakpoints set in the Debugger and Script window are not saved in the FLA file and are valid only for the current debugging session.
You can view breakpoints in both the Debugger and the Script window by setting them in either one of those windows. For this to work, the path to the AS file must be the same in both windows.
Do not set breakpoints on comments or empty lines; these breakpoints are ignored.
Set or remove a breakpoint in the
Actions panel or Script windowDuring a debugging session, do one of the following:
Click in the left margin of the Script pane. A red dot indicates a breakpoint.
Click Debug Options
button.
Right-click (Windows) or Control-click (Macintosh) to display the context menu, and select Set Breakpoint, Remove Breakpoint, or Remove Breakpoints In This File. (In the Script window, you can also select Remove Breakpoints In All AS Files.)
Press Control+Shift+B (Windows) or Command+Shift+B (Macintosh).
Set and remove breakpoints in the
Debugger
The breakpoints XML fileWhen you work with breakpoints in the Script window, the AsBreakpoints.xml file lets you store breakpoint information. This file is written to the Local Settings directory, in the following locations:
Hard Disk\Documents and Settings\User\Local Settings\Application Data\Adobe\Flash CS3\language\Configuration\Debugger\
Macintosh HD/Users/User/Library/Application Support/Adobe Flash CS3/Configuration/Debugger/
Here is an example of an AsBreakpoints.xml file:
<?xml version="1.0"?> <flash_breakpoints version="1.0"> <file name="c:\tmp\myscript.as"> <breakpoint line="10"></breakpoint> <breakpoint line="8"></breakpoint> <breakpoint line="6"></breakpoint> </file> <file name="c:\tmp\myotherscript.as"> <breakpoint line="11"></breakpoint> <breakpoint line="7"></breakpoint> <breakpoint line="4"></breakpoint> </file> </flash_breakpoints>
The XML file consists of the following tags:
This node has a version attribute, which specifies the version of the XML file. Flash 8 is version 1.0.
A child node of flash_breakpoints. This node has a name attribute, which specifies the name of the file that contains breakpoints.
A child node of file. This node has a line attribute, which specifies the line number that contains the breakpoint.
The AsBreakpoints.xml file is read when you start Flash, and regenerated when you quit. AsBreakpoints.xml is used to keep track of the breakpoints between development sessions.