Set and remove breakpoints – Adobe Flash Professional CC 2014 v.13.0 User Manual
Page 647

In the test environment, the List Variables command shows a list of all the variables in the SWF file. Global variables (those declared with the
_global identifier) appear at the top of the List Variables output in a Global Variables section, and each variable has a _global prefix.
In addition, the List Variables command shows getter/setter properties—properties that are created with the Object.addProperty() method and start
get or set methods. In the Output panel, the value of a getter/setter property is prefixed with [getter/setter]. The software determines the value that
appears for a getter/setter property by evaluating the get function.
The list does not update automatically as the SWF file plays; you must select the List Variables command each time you want to send the
information to the Output panel.
1. Create a new FLA document. For example, you might call it listvariables.fla.
2. Add the following ActionScript 2.0 in the Actions panel:
_global.myName = "Buster";
var myCatSays:String = "meow";
var myNum:Number = 313;
var myArray:Array = ["one", "two", "three"];
3. Select Control > Test.
4. Select Debug > List Variables in the test environment.
A list of all the variables currently in the SWF file appears in the Output panel. The following example shows the variables that would be
output from the code listed above in step 2:
Global Variables:
Variable _global.myName = "Buster"
Level #0:
Variable _level0.$version = "WIN 9,0,29,3"
Variable _level0.myCatSays = "meow"
Variable _level0.myNum = 313
Variable _level0.myArray = [object #1, class 'Array'] [ 0:"one",
1:"two",
2:"three"
]
Set and remove breakpoints
A breakpoint lets you stop an 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.
Important: If you set breakpoints in the Actions panel or Script window and click Auto Format, check your breakpoints. If the Auto Format
command removed empty lines, your ActionScript might be moved to a different line. It’s a good idea to autoformat your scripts before you set
breakpoints.
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 window
During 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).
Note: In some previous versions of Flash, clicking in the left margin of the Script pane selected the line of code; now it adds or removes a
breakpoint. To select a line of code, use Control-click (Windows) or Command-click (Macintosh).
Set and remove breakpoints in the Debugger
Click in the left margin of the code pane. A red dot indicates a breakpoint.
640