Use syntax coloring, Use line numbers and word wrap – Adobe Flash Professional CS3 User Manual

Page 401

Advertising
background image

FLASH CS3

User Guide

395

Remove a comment

1

Place the insertion point in the line that contains the comment, or select the block of code that is commented.

2

Click Remove Comment

.

Use syntax coloring

In ActionScript, as in any language, syntax is the way elements are put together to create meaning. If you use
incorrect ActionScript syntax, your scripts cannot work.

To highlight syntax errors, set a color-code for parts of your scripts. For example, suppose you set the syntax coloring
preference to make keywords appear in blue. When you type

var

, the word

var

appears in blue. However, if you

mistakenly type

vae

, the word

vae

remains black, which shows that you made a typing error.

Do one of the following:

Select Edit > Preferences (Windows) or Flash > Preferences (Macintosh), click ActionScript in the Category list,
and specify Syntax Coloring settings.

From the panel menu

(at the upper-right corner of the Actions panel), select Preferences and specify Syntax

Coloring settings.

With the insertion point in the Script pane, press Control-U (Windows) or Command-U (Macintosh).

Note: When you write scripts in the Actions panel, commands that are not supported by the version of the player you
are targeting appear in yellow in the Actions toolbox. For example, if the Flash Player SWF file version is set to Flash 7,
ActionScript that only Flash Player 8 supports appears in yellow in the Actions toolbox.

See also

“Set ActionScript preferences” on page 386

Use line numbers and word wrap

When you edit or modify code, line numbers make code easier to scroll and parse. Word wrap helps you avoid
horizontally scrolling long lines of code (especially when you work in the authoring environment, or at low screen
resolutions).

Enable or disable line numbers

From the panel menu

(at the upper-right corner of the Actions panel), select Line Numbers.

In the Script window, select View > Line Numbers.

Press Control+Shift+L (Windows) or Command+Shift+L (Macintosh).

Highlight a specific line

From the panel menu

(at the upper-right corner of the Actions panel), select Go To Line.

In the Script window, select Edit > Go To Line.

Enable or disable line word wrap

From the panel menu

(at the upper-right corner of the Actions panel), select Word Wrap.

In the Script window, select View > Word Wrap.

Press Control+Shift+W (Windows) or Command+Shift+W (Macintosh).

Advertising