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 will not 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.)

You can also set a preference to have Flash "color-code" parts of your scripts as you write them, to bring typing errors to your attention. For example, suppose you set your Syntax coloring preference to have keywords appear in deep green. While you are typing code, if you type var, the word var appears in green. However, if you mistakenly type vae, the word vae remains black, providing you with an immediate clue that you made a typing error.

To set preferences for syntax coloring as you type, do one of the following: