beautypg.com

Use the watch list – Adobe Flash Professional CC 2014 v.13.0 User Manual

Page 645

background image

To the top

To the top

The debug session begins when the debug player connects to the Flash ActionScript 2.0 Debugger panel.

Activate the Debugger from a remote location

1. Open the Flash authoring application if it is not already open.

2. Select Debug > Begin Remote Debug Session > ActionScript 2.0.

3. In a browser or in the debugger version of the stand-alone player, open the published SWF file from the remote location. Be sure the SWD

file is in the same folder as the SWF file.

If the Remote Debug dialog box does not appear, right-click (Windows) or Control-click (Macintosh) in the SWF file to display the context
menu, and select Debugger.

4. In the Remote Debug dialog box, select Localhost or Other Machine:

Select Localhost if the debugger version of Flash Player and the Flash authoring application are on the same computer.

Select Other Machine if the debugger version of Flash Player and the Flash authoring application are not on the same computer. Enter
the IP address of the computer running the Flash authoring application.

Select Don't show this dialog at launch to prevent the Remote Debug dialog box from prompting the user for a debugger location if one
cannot be found. This option is selected by default.

5. Enter your debugging password if you set one.

The display list of the SWF file appears in the Debugger. If the SWF file doesn’t play, the Debugger might be paused, so click Continue to
start it.

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.

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.

638