Stepping through lines of code – Adobe Flash Professional CC 2014 v.13.0 User Manual
Page 648

Click Toggle Breakpoint or Remove All Breakpoints above the code view.
Right-click (Windows) or Control-click (Macintosh) to display the context menu, and select Set Breakpoint, Remove Breakpoint, or Remove
All Breakpoints in the File.
Press Control+Shift+B (Windows) or Command+Shift+B (Macintosh).
The breakpoints XML file
When 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:
Windows Hard Disk\Documents and Settings\User\Local Settings\Application Data\Adobe\Flash CS3\language\Configuration\Debugger\
Macintosh Macintosh HD/Users/User/Library/Application Support/Adobe Flash CS3/Configuration/Debugger/
Here is an example of an AsBreakpoints.xml file:
The XML file consists of the following tags:
flash_breakpoints This node has a version attribute, which specifies the version of the XML file. Flash 8 is version 1.0.
file A child node of flash_breakpoints. This node has a name attribute, which specifies the name of the file that contains breakpoints.
breakpoint 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.
Stepping through lines of code
After you set breakpoints in a script and click Continue in the Debugger, you can step through lines of code—that is, control how the Debugger
moves through statements and functions.
For example, in the following ActionScript 2.0 code, suppose a breakpoint is set inside a button on the myFunction() line:
on(press){
myFunction();
}
When you click the button, Flash Player reaches the breakpoint and pauses. You can now bring the Debugger to the first line of myFunction()
wherever it is defined in the document. You can also continue through or exit out of the function.
As you step through lines of code, the values of variables and properties change in the Variables, Locals, Properties, and Watch tabs. A yellow
arrow on the left side of the Debugger’s code view indicates the line at which the Debugger stopped. Use the following buttons along the top of the
code view:
Step In
Advances the Debugger into a function. (If a line does not contain a user-defined function, Step In advances to the next line.)
In the following example, if you place a breakpoint at line 7 and click Step In, the Debugger advances to line 2, and another click of Step In
advances you to line 3.
1 function myFunction() {
2 x = 0;
3 y = 0;
4 }
5
6 mover = 1;
7 myFunction();
8 mover = 0;
Note: The numbers in this code snippet denote line numbers. They are not part of the code.
641