722 Debugging Applications
An example of the AsBreakpoints.xml is as follows:
<?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:
flash_breakpoints This node has an attribute, called version, that indicates the version of
the XML file. Flash 8 is version 1.0.
file A child node of flash_breakpoints. This node has one attribute, called name, that
indicates the name of the file that contains breakpoints.
breakpoint A child node of file. This node has an attribute, called line, that indicates the
line number where the breakpoint exists.
The AsBreakpoints.xml file is read when you launch Flash, and generated again when you
shut down Flash. AsBreakpoints.xml is used to keep track of the breakpoints between Flash
development sessions. An internal data structure maintains the breakpoints as you set and
remove them while developing in Flash.
About working through lines of code
When you start a debugging session, Flash Player is paused so that you can toggle breakpoints.
If you set breakpoints in the Actions panel, you can click Continue to play the SWF file until
it reaches a breakpoint. If you didn’t set breakpoints in the Actions panel, you can use the
jump menu in the Debugger to select any script in the SWF file. When you have selected a
script, you can add breakpoints to it.
After adding breakpoints, you must click Continue to start the SWF file. The Debugger stops
when it reaches the breakpoint. For example, in the following code, suppose a breakpoint is
set inside a button on the
myFunction() line:
on(press){
myFunction();
}