beautypg.com

Control compiler warnings – Adobe Flash Professional CS3 User Manual

Page 413

background image

FLASH CS3

User Guide

407

on(press){

myFunction();

}

When you click the button, Flash Player reaches the breakpoint and pauses. You can now bring the Debugger to the
first line of

myFunction()

wherever it is defined in the document. You can also continue through or exit out of the

function.

As you step through lines of code, the values of variables and properties change in the Variables, Locals, Properties,
and Watch tabs. A yellow arrow on the left side of the Debugger’s code view indicates the line at which the Debugger
stopped. Use the following buttons along the top of the code view:

Step In

Advances the Debugger into a function. (If a line does not contain a user-defined function, Step In

advances to the next line.)

In the following example, if you place a breakpoint at line 7 and click Step In, the Debugger advances to line 2, and
another click of Step In advances you to line 3.

1 function myFunction() {

2 x = 0;

3 y = 0;

4 }

5

6 mover = 1;

7 myFunction();

8 mover = 0;

Note: The numbers in this code snippet denote line numbers. They are not part of the code.

Step Out

Advances the Debugger out of a function. This button works only if you are currently stopped in a

user-defined function; it moves the yellow arrow to the line that follows the function call. In the previous example,
if you place a breakpoint at line 3 and click Step Out, the Debugger moves to line 8. Clicking Step Out at a line that
is not within a user-defined function is the same as clicking Continue. For example, if you stop at line 6 and click
Step Out, the player continues to execute the script until it encounters a breakpoint.

Step Over

Advances the Debugger over a line of code. This button moves the yellow arrow to the next line in the

script. In the previous example, if you are stopped at line 7 and click Step Over, you advance directly to line 8 without
stepping through

myFunction()

, although the

myFunction()

code still executes.

Continue

Leaves the line at which the player is stopped and continues playing until a breakpoint is reached.

End Debug Session

Makes the Debugger inactive but continues to play the SWF file in Flash Player.

Control compiler warnings

You can control the types of compiler warnings that the ActionScript compiler generates in the Compiler Errors
panel. When the compiler reports an error, you can double click on the error to navigate to the line of code that
caused the error.

1

Select File > Publish Settings.

2

Click the Flash tab.

3

Click the ActionScript Settings button.

4

Select among the Errors options:

Strict Mode causes warnings to be reported as errors, which means that compilation will not succeed if those
errors exist.