Tải bản đầy đủ (.pdf) (5 trang)

Thiết kế flash với flash cs5 part 67

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (607.21 KB, 5 trang )

ptg
Chapter 17 Debugging a Movie
415

Show Symbol Definitions.
Select to display all the
elements associated with a
symbol.

Copy All Text To Clipboard.
Select to copy selected text to
the Clipboard.

Cut, Copy, Paste, And Clear.
Select to perform these
functions on a selected
element.

Expand Branch. Select to
expand the navigation tree at
the selected element.

Collapse Branch. Select to
collapse the navigation tree at
the selected element.

Collapse Others. Select to
collapse the branches in the
navigation tree not containing
the selected element.


Print. Select to print the
hierarchical display list
currently displayed in the
Movie Explorer.
The Show buttons give you the
option to show or hide different
elements of the movie. These
options will only impact the Movie
Explorer, not the Flash Stage.

Show Text

Show Buttons, Movie Clips,
and Graphics

Show ActionScripts

Show Video, Sounds, and
Bitmaps

Show Frames and Layers
Click the Customize Which Items
To Show button to customize what
items display in the Movie Explorer
window.
4
3
43
From the Library of Wow! eBook
ptg

416
Chapter 17
The designers of Flash included editing and debugging features to
make debugging easier. You can quickly set and remove breakpoints to
check different parts of your code to determine if it’s working correctly.
Flash uses a different debugger for ActionScript 3.0 files (FLA or AS)
than it does for ActionScript 2.0 files. The functionality is similar, but the
look and feel is different. The debugger for ActionScript 3.0 uses the
Debug workspace that displays the Debug Console, Variables, and
Output panels along with the Actions panel or Script window. The
Debug Console displays the call stack, scripts containing the functions
in the call stack, and contains buttons to step through the code. The
call stack shows the current list of nested function calls ready for exe-
cution. The Variables panel displays variables and their current values.
When a problem is encountered, Flash displays the line of code in the
Compiler Errors panel. Double-click the error to view it in the code.
Debugging for
ActionScript 3.0
Use the Debugger for
ActionScript 3.0
Create or open a Flash document
(ActionScript 3.0).

To debug an ActionScript 3.0
file (AS), open the file in the
Script window, select the
associated Flash file from the
Target menu.
Click the Debug menu, point to
Debug Movie, and then click

Debug.

You can access debugging
commands on the Debug menu.
Add or remove breakpoints to
interrupt the execution of the
scripting code.

Add. Click in the left margin
next to the line of code.

Remove. Click the breakpoint in
the left margin.
To step through the code line by
line or step in and out of functions,
use any of the following:

Step into code line by line.
Click the Step In button in the
Debug Console panel.

Step over a function call. Click
the Step Over button in the
Debug Console panel.
4
3
2
1
3
4

Output panel
Actions
panel
2 1
From the Library of Wow! eBook
ptg
Chapter 17 Debugging a Movie
417

Step out of a function call.
Click the Step Out button in the
Debug Console panel.

Resume normal code
execution. Click the Continue
button in the Debug Console
panel.
To view the individual scripts that
contain each function, double-
click the script name in the call
stack in the Debug Console panel.
To view variable values, click the
Options button on the Variables
panel, and then click one of the
following:

Show Constants. Displays the
values constants.

Show Statics. Displays

variables for the class instead
of instances of the class.

Show Inaccessible Member
Variables. Displays variables
that are inaccessible to other
classes or namespaces.

Show Additional Hexadecimal
Display. Displays hexadecimal
values instead of decimal
values.

Show Qualified Names.
Displays variable types with
both the package name and the
class name.
To edit the values of variables in
the Variables panel, double-click
the value, enter a new value, and
then press Enter (Win) or Return
(Mac).
If an error occurs, double-click it
in the Compiler Errors panel.
To exit debugging mode, click the
End Debug Session button in the
Debug Console panel. To change
workspaces, click the Workspace
menu, and then select one.
9

8
7
6
5
7
9
Continue
6
8
From the Library of Wow! eBook
ptg
When a problem is encountered, Flash displays the location and
description of the warnings and errors in the Compiler Errors panel. In
the Compiler Errors panel, you can show or hide warnings or errors
(
New!
), scroll through each one (
New!
), and display/highlight them in
the code (
New!
). You can also manage the types of compiler warning
that appear in the Compiler Errors panel by setting options in the
Publish Settings dialog box. Two options are available: Strict Mode and
Warnings Mode. Strict Mode reports warnings as errors, while
Warnings Mode reports extra warnings for discovering incompatibili-
ties when updating ActionScript 2.0 code to ActionScript 3.0.
418
Chapter 17
Resolving Compiler

Errors
Resolve Compiler Errors
Create or open a Flash document
(ActionScript 3.0).
Click the Control menu, point to
Test Movie, and then click Test.
If an error occurs, the Compiler
Errors panel opens displaying the
errors found during the execution.
Open the Compiler Errors panel.
In the Compiler Errors panel, use
the following options to resolve
compiler errors:

View Warnings or Errors in the
Code. Select the warning or
error, and then click the Go To
Source button, or double-click
the warning or error to display
it in the Actions panel.

Display Warnings or Errors.
Click the Go To Previous or Go
To Next button. The code line
with the error highlights in the
Actions panel.

Clear Warnings and Errors.
Click the Clear button.


Show or Hide Warnings or
Errors. Click the Warning(s) or
Error(s) button at the bottom of
the Compiler Errors panel.
4
3
2
1
3
Show or hide errors
or warnings
4
Source of error from the Compiler Errors panel
Errors due to a change from
ActionScript 2.0 to ActionScript 3.0
From the Library of Wow! eBook
ptg
Chapter 17 Debugging a Movie
419
Control Compiler Warnings
Create or open a Flash document
(ActionScript 3.0).
Click the File menu, and then click
Publish Settings.
Click the Flash tab.
Click the Settings button for
ActionScript 3.0
Select the Strict Mode check box
to report warnings as errors.
Select the Warnings Mode check

box to report extra warnings for
discovering incompatibilities when
updating ActionScript 2.0 code to
ActionScript 3.0 code.
Click OK.
Click OK.
8
7
6
5
4
3
2
1
3
4
8
7
6
5
From the Library of Wow! eBook

×