Debugging Your Scripts - MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual

Actionscript reference guide
Hide thumbs Also See for FLASH MX 2004 - ACTIONSCRIPT:
Table of Contents

Advertisement

Debugging your scripts

Flash provides several tools for testing ActionScript in your SWF files. The Debugger, discussed
in the rest of this section, lets you find errors in a SWF file while it's running in Flash Player. Flash
also provides the following additional debugging tools:
The Output panel, which displays error messages and lists of variables and objects (see
the Output panel" on page
The
statement, which sends programming notes and values of expressions to the
trace
Output panel (see
The
and
throw
errors from within your script
The availability of comprehensive compiler error messages, which let you diagnose and fix
problems more readily (see
You must be viewing your SWF file in a special version of Flash Player called Flash Debug Player.
When you install the authoring tool, Flash Debug Player is installed automatically. So if you
install Flash and browse a website that has Flash content, or do a Test Movie, then you're using
Flash Debug Player. You can also run the installer in the <app_dir>\Players\Debug\ directory, or
launch the stand-alone Flash Debug Player from the same directory.
When you use the Test Movie command to test movies that implement keyboard controls
(tabbing, keyboard shortcuts created using
Disable Keyboard Shortcuts. 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 will open 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.
Caution: The Test Movie command fails if any part of the SWF file path has characters that cannot
be represented using the MBCS encoding scheme. For example, Japanese paths on an English
system do not work. All areas of the application that use the external player are subject to
this limitation.
The Debugger shows a hierarchical display list of movie clips currently loaded in Flash Player.
Using the Debugger, you can display and modify variable and property values as the SWF file
plays, and you can use breakpoints to stop the SWF file and step through ActionScript code line
by line.
You can use the Debugger in test mode with local files, or you can use it to test files on a web
server in a remote location. The Debugger lets you set breakpoints in your ActionScript that stop
Flash Player and step through the code as it runs. You can then go back to your scripts and edit
them so that they produce the correct results.
After it's activated, the Debugger status bar displays the URL or local path of the file, tells
whether the file is running in test mode or from a remote location, and shows a live view of the
movie clip display list. When movie clips are added to or removed from the file, the display list
reflects the changes immediately. You can resize the display list by moving the horizontal splitter.
68
Chapter 3: Writing and Debugging Scripts
77)
"Using the trace statement" on page 79
try..catch..finally
Appendix A, "Error Messages," on page
)
statements, which let you test and respond to runtime
, and so on), select Control >
Key.addListener()
"Using
783)

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents