About coding in the Actions panel and Script window
51
To format code according to Auto Format settings, do one of the following:
■
Click the Auto Format button in the Actions panel or Script window toolbar.
■
In the Actions panel, select Auto Format from the pop-up menu.
■
Press Shift+F (Windows) or Shift+F (Macintosh).
■
In the Script window, select Tools > Auto Format.
To use dynamic font mapping:
■
To turn dynamic font mapping on or off, select or deselect Use dynamic font mapping in
the Preferences dialog box.
Dynamic font mapping is turned off by default because it increases performance time
when you are scripting. If you are working with multilingual text, turn on dynamic
font mapping because it helps to ensure that the correct fonts are used.
To use automatic indentation:
■
To turn automatic indentation on or off, select or deselect Automatic indentation in the
Preferences dialog box.
When automatic indentation is turned on, the text you type after an opening parenthesis
[(] or opening curly brace ({) is automatically indented according to the Tab size setting in
ActionScript preferences.
In your scripts, you can indent a line by selecting the line and pressing Tab. To remove the
indent, select the line and press Shift+Tab.
Using syntax highlighting
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.
When you write scripts in Flash Basic 8 and Flash Professional 8, 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 is
supported only by Flash Player 8 appears in yellow in the Actions toolbox. (For information
on setting the Flash Player SWF file version, see
Chapter 17, “Setting publish options for the
Flash SWF file format”
in
Using Flash
.
You can also set a preference to have Flash color-code parts of your scripts as you write them,
which brings attention to typing errors. For example, suppose you set the Syntax coloring
preference to make keywords appear in deep blue. While you type code, if 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. For information on keywords, see
“About
keywords” on page 138
.
Содержание FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Страница 1: ...Learning ActionScript 2 0 in Flash...
Страница 8: ...8 Contents...
Страница 18: ...18 Introduction...
Страница 30: ...30 What s New in Flash 8 ActionScript...
Страница 66: ...66 Writing and Editing ActionScript 2 0...
Страница 328: ...328 Interfaces...
Страница 350: ...350 Handling Events...
Страница 590: ...590 Creating Interaction with ActionScript...
Страница 710: ...710 Understanding Security...
Страница 730: ...730 Debugging Applications...
Страница 780: ...780 Deprecated Flash 4 operators...
Страница 830: ...830 Index...