Understanding ActionScript > Using the Actions panel > Highlighting and checking syntax

Highlighting and checking syntax

Syntax highlighting identifies certain ActionScript elements with specific colors. This helps prevent syntax errors such as incorrect capitalization of keywords. For example, if the keyword typeof was spelled typeOf, it would not be blue and you could recognize the error. When syntax highlighting is turned on, text is highlighted in the following way:

Keywords and predefined identifiers (for example, gotoAndStop, play, and stop) are blue.
Properties are green.
Comments are magenta.
Strings surrounded by quotation marks are gray.

To turn syntax highlighting on or off:

Choose Colored Syntax from the pop-up menu at the upper right of the Actions panel. A check mark indicates that the option is turned on. All scripts in your movie will be highlighted.

It's a good idea to check a script's syntax for errors before exporting a movie. Errors are reported in the Output window. You can export a movie that contains erroneous scripts. However, you will be warned that scripts containing errors were not exported.

To check the current script's syntax for errors:

Choose Check Syntax from the pop-up menu at the upper right of the Actions panel.