Debug a local swf file, Debug a remote actionscript 2.0 swf file – Adobe Flash Professional CC 2014 v.13.0 User Manual
Page 644

When you use the Control > Test command to test SWF files that implement keyboard controls (tabbing, keyboard shortcuts created using
Key.addListener(), and so on), select Control > Disable Keyboard Shortcuts in the Test Movie window. Selecting this option prevents the authoring
environment from “grabbing” keystrokes, and lets them pass through to the player. For example, in the authoring environment, Control+U opens
the Preferences dialog box. If your script assigns Control+U to an action that underlines text onscreen, when you use Test Movie, pressing
Control+U opens the Preferences dialog box instead of running the action that underlines text. To let the Control+U command pass through to the
player, you must select Control > Disable Keyboard Shortcuts in the Test Movie window.
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 > Debug.
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. In the Publish Settings dialog box, click the Flash tab (CS5) or Flash category (CS5.5), and then 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 > Debug
File > Export > Export Movie
File > Publish
Flash creates a debugging file, with the extension .swd, and saves it in the same directory as the SWF file. The SWD file is used to
debug ActionScript, and contains information that lets you use breakpoints and step through code.
6. Upload the SWF file and the SWD file to the same directory on your web server, or leave it on the local machine to perform a remote debug
session on the localhost.
If the SWD file is not in the same directory as the SWF file, you can still debug remotely; however, the Debugger has no breakpoint
information, so you can’t step through code.
7. In Flash, select Debug > Begin Remote Debug Session > ActionScript 2.0.
Flash opens the ActionScript 2.0 Debugger panel and waits for a debug Flash Player to connect. You have 2 minutes to start the debug
Flash Player. If more than 2 minutes elapse, repeat this step.
8. Open the SWF file in the debug version of the Flash Player plugin, ActiveX control, or stand-alone player. The debug stand-alone player is
located in the Flash install directory/Players/Debug/ directory.
637