User Guide

Debugging your scripts 161
When you click the button, the breakpoint is reached and Flash Player pauses. You can now step
in to bring the Debugger to the first line of
myFunction() wherever it is defined in the
document. You can also step through or out of the function.
As you step through lines of code, the values of variables and properties change in the Watch list
and in the Variables, Locals, and Properties 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 (indicated by the yellow arrow) into a function. Step In works
only for user-defined functions.
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 will advance you to line 3. Clicking Step In for
lines that do not have user-defined functions in them advances the Debugger over a line of code.
For example, if you stop at line 2 and select Step In, the Debugger advances to line 3, as shown in
the following example:
1 function myFunction() {
2 x = 0;
3 y = 0;
4 }
5
6 mover = 1;
7 myFunction();
8 mover = 0;
Step Out
advances the Debugger out of a function. This button works only if you are currently
stopped in a user-defined function; it moves the yellow arrow to the line after the one where that
function was called. In the previous example, if you place a breakpoint at line 3 and click Step
Out, the Debugger moves to line 8. Clicking Step Out at a line that is not within a user-defined
function is the same as clicking Continue. For example, if you stop at line 6 and click Step Out,
the player continues executing the script until it encounters a breakpoint.
Step Over advances the Debugger over a line of code. This button moves the yellow arrow to the
next line in the script. In the previous example, if you are stopped at line 7 and click Step Over,
you advance directly to line 8 without stepping through
myFunction(), although the
myFunction() code still executes.
Stop Debugging
Toggle Breakpoint
Remove All Breakpoints
Continue
Step Over
Step In
Step Out