Display and modify the values of variables in the Debugger

The Variables tab in the Debugger shows the names and values of any global and timeline variables that are selected in the SWF file’s display list. If you change the value of a variable on the Variables tab, the change is reflected in the SWF file while it runs. For example, to test collision detection in a game, you can enter the variable value to position a ball in the correct location next to a wall.

The Locals tab in the Debugger shows the names and values of any local variables that are available in the line of ActionScript where the SWF file is currently stopped, at a breakpoint or anywhere else within a user-defined function.

Display a variable and its value

  1. In the Debugger’s display list, select the movie clip containing the variable. (To display global variables, select the _global clip in the display list.)
  2. Click the Variables tab.

The display list updates automatically as the SWF file plays.

Note: If a movie clip is removed from the SWF file at a specific frame, that movie clip, along with its variable and variable name, is also removed from the display list in the Debugger. However, if its variable is marked for the Watch list, you can still view it in the Watch tab.

Modify a variable value

 On the Debugger panel Variables tab, double-click the value, and enter a new value.

Enter a string (any value surrounded by quotation marks), a number, or a Boolean value (true or false). You cannot enter an expression (for example, eval("name:" +i) or x + 2).

Note: To write the value of an expression to the Output panel in the test environment, use the trace() statement.

  This page on the Web