Set and remove breakpoints – Adobe Flash Professional CS3 User Manual

Page 411

Advertising
background image

FLASH CS3

User Guide

405

Remove variables from the Watch list

On the Watch tab or the Variables tab, right-click (Windows) or Control-click (Macintosh) and select Remove

from the context menu.

Display movie clip properties and change editable properties

The Debugger’s Properties tab shows all the property values of any movie clip on the Stage. If you change a value,
you can see its effect in the SWF file while it runs. (Some movie clip properties are read-only and cannot be changed.)

Display a movie clip’s properties in the Debugger

1

Select a movie clip from the display list.

2

Click the Properties tab in the Debugger.

Modify a property value

In the Debugger’s Properties 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,

x + 50

), or object or array values (for example,

{id: "rogue"}

or

[1,

2, 3]

).

Note: To write the value of an expression to the Output panel in the test environment, use the

trace()

statement.

Set and remove breakpoints

A breakpoint lets you stop a Flash 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).

Advertising