FLASH CS3
User Guide
402
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.
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.
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.
See also
“List a SWF file’s objects and variables” on page 407