Use the watch list – Adobe Flash Professional CS3 User Manual

Page 410

Advertising
background image

FLASH CS3

User Guide

404

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.

Use the Watch list

To monitor a set of critical variables, you can mark them for the Watch list. The Watch list shows the absolute path
to the variable and the value. You can also enter a new variable value in the Watch list. The Watch list shows only
variables that you access by using an absolute target path, such as

_global

or

_root

.

If you add a local variable to the Watch list, its value appears only when Flash Player stops at a line of ActionScript
that is within the variable’s scope. All other variables appear while the SWF file is playing. If the Debugger can’t find
the value of the variable, the value is listed as undefined.

Variables marked for the Watch list and variables in the Watch list

Add variables to the Watch list

On the Variables or Locals tab, right-click (Windows) or Control-click (Macintosh) a selected variable; then select
Watch from the context menu. A blue dot appears next to the variable.

On the Watch tab, right-click (Windows) or Control-click (Macintosh) and select Add from the context menu.
Double-click in the name column, and enter the target path to the variable name.

Advertising