Format code

Your code can be formatted and indented automatically or manually. If you use dynamic font mapping, you ensure that the correct fonts are used for multilingual text.

Set Auto Format options

  1. Do one of the following:
    • From the panel menu  (at the upper-right corner of the Actions panel), select Preferences.

    • In the Script window, select Edit > Preferences (Windows) or Flash > Preferences (Macintosh).

  2. In the Preferences dialog box, select Auto Format.
  3. Select any of the Auto Format options.

    After you set Auto Format options, your settings are applied automatically to the code you write, but not to existing code; you must apply your settings to existing code manually.

Format code according to Auto Format settings

  • Click Auto Format  in the Actions panel or Script window toolbar.
  • From the panel menu (at the upper-right corner of the Actions panel), select Auto Format.
  • Press Control+Shift+F (Windows) or Command+Shift+F (Macintosh).
  • In the Script window, select Tools > Auto Format.

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.

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 it and pressing Tab. To remove the indent, select the line and press Shift+Tab.

  This page on the Web