User Guide
144 Chapter 4: Writing and Debugging Scripts
To use keyboard shortcuts with pinned scripts:
• You can use the following keyboard shortcuts to work with pinned scripts:
Using the ActionScript editor
When you use the ActionScript editor (in either the Actions Panel or, in Flash MX Professional
2004, the Script window), you can use several features to help you write syntactically correct code
and set preferences for code formatting and other options. The following capabilities are discussed
in this section:
• “Syntax highlighting” on page 144
• “Writing code that triggers code hints” on page 145
• “Using code hints” on page 147
• “Using Escape shortcut keys” on page 149
• “Checking syntax and punctuation” on page 150
• “Formatting code” on page 151
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 MX 2004 and Flash MX Professional 2004, 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 version is set to Flash 6, ActionScript that is
supported only by Flash Player 7 appears in yellow in the Actions toolbox. (For information on
setting the Flash Player SWF version, see “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 have 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 “Keywords and reserved
words” on page 32.
Action Windows shortcut key Macintosh shortcut key
Pin script Control+= (equal sign) Command+=
Unpin script Control+- (minus sign) Command+-
Move focus to tab on the right Control+Shift+. (period) Command+Shift+.
Move focus to tab on the left Control+Shift+, (comma) Command+Shift+,
Unpin all scripts Control+Shift+- (minus) Command+Shift+-