User Guide

Using the ActionScript editor 151
Note: If you Check Syntax in external ActionScript 2.0 class files, the global class path will affect this
process. Sometimes you will generate errors—even if the global class path is set correctly—because
the compiler is not aware that this class is being compiled. For more information on compiling
classes, see “Compiling and exporting classes” on page 272.
To check for punctuation balance:
1.
Click between braces ({}), brackets ([]), or parentheses [()] in your script.
2.
For Windows, press Control+' (single quote) or Command+' (Macintosh) to highlight the text
between braces, brackets, or parentheses.
The highlighting helps you check that opening punctuation has corresponding closing
punctuation.
Formatting code
You can specify settings to determine if your code is formatted and indented automatically or
manually. You can also select whether to view line numbers and whether to wrap long lines
of code. In addition, you can select whether to use dynamic font mapping, which ensures that the
correct fonts are used when working with multilingual text.
To set format options:
1.
Do one of the following
In the Actions panel, select Auto Format Options from the Options pop-up menu (at the
upper right of the panel).
(Flash Professional only) In an external script file, select Edit > Auto Format Options.
The Auto Format Options dialog box appears.
2.
Select any of the check boxes. To see the effect of each selection, look in the Preview pane.
After you set Auto Format Options, your settings are applied automatically to code you write, but
not to existing code; you must apply your settings to existing code manually. You might use this
procedure to format code that was formatted using different settings, code that you imported
from another editor, and so on.
To format code according to Auto Format Options settings:
Do one of the following:
Click the Auto Format button above the Script pane.
Select Auto Format from the Actions panel Options pop-up menu.
Press Control+Shift+F (Windows) or Command+Shift+F (Macintosh).
In an external script file, select Tools > Auto Format.
To use dynamic font mapping:
Dynamic font mapping is turned off by default because it increases performance time when
scripting. To turn it on, select Use dynamic font mapping in ActionScript preferences.
If you are working with multilingual text, you should turn on dynamic font mapping, which
helps ensure that the correct fonts are used.