beautypg.com

Debug a local swf file, Debug a remote actionscript 2.0 swf file – Adobe Flash Professional CS3 User Manual

Page 408

background image

FLASH CS3

User Guide

402

Important: When you use a non-English application on an English system, the Test Movie command fails if any part of
the SWF file path has characters that cannot be represented with the MBCS encoding scheme. For example, Japanese
paths on an English system do not work.

Other debugging tools

Flash also provides the following debugging tools:

The Compiler Errors panel, which shows errors encountered when Flash compiles your scripts

The Output panel, which shows runtime error messages, and lists of variables and objects

The

trace()

statement, which sends programming notes and values of expressions to the Output panel

The

throw

and

try..catch..finally

statements, which let you test and respond to runtime errors from within

your script

Debug a local SWF file

1

Open the FLA document.

2

Select Debug > Debug Movie.

This command exports the SWF file with debugging information (the SWD file). It opens the Debugger and opens
the SWF file in the test environment. The SWD file is used to debug ActionScript, and contains information that lets
you use breakpoints and step through code.

Debug a remote ActionScript 2.0 SWF file

You can debug a remote SWF file by using the stand-alone, ActiveX, or plug-in version of the Debug Flash Player,
which you can find in the Flash install directory/Players/Debug/ directory.

To permit remote debugging of the file, enable debugging in the Publish settings. You can also publish your file with
a debugging password to ensure that only trusted users can debug it.

As in JavaScript or HTML, users can view client-side variables in ActionScript. To store variables securely, send them
to a server-side application instead of storing them in your file. However, as a developer, you may have other trade
secrets, such as movie clip structures, that you do not want to reveal. You can use a debugging password to protect
your work.

Enable remote debugging of a SWF file and set a debugging password

1

Open the FLA file.

2

Select File > Publish Settings.

3

On the Flash tab of the Publish Settings dialog box, select Permit Debugging.

4

To set a password, enter a password in the Password box.

After you set this password, no one can download information to the Debugger without the password.

5

Close the Publish Settings dialog box, and select one of the following commands:

Debug > Debug Movie

File > Export > Export Movie

File > Publish