# <<to be re-org'd/rewritten>>

# Writing scripts -where

<<explain that Script editor means script pane of actions panel and also script window that opens if you are editing AS or JSFL file>>

## Using the Actions panel

You create scripts that are part of your document by entering ActionScript directly into the Script pane on the right side of the Actions panel. You edit actions, enter parameters for actions, or delete actions directly in the Script pane, much as you would create a script in a text editor. You can also use the Actions toolbox (the left side of the Actions panel) and the Add (+) button to add actions to the Script pane.

You can also check syntax for errors, automatically format code, and use code hints to help you complete syntax. In addition, the punctuation balance feature helps you pair parentheses, braces, or brackets.

To display the Actions panel :

- Do one of the following:

- Choose Window > Development panels > Actions.
- Press F9.

Note: If the panel is already open when you do either of the above, the action toggles between displaying and minimizing it.

To check syntax, do one of the following:

- Click the Check Syntax button.
- Select Check Syntax from the Actions panel pop-up menu (at the upper right of the panel). Syntax errors are listed in Output panel.
- Press Control+T (Windows) or Command+T (Macintosh).

To format code using the Flash formatting style, do one of the following:

- Click the Auto Format button.
- Select Auto Format from the Actions panel pop-up menu.
- Press Control+Shift+F (Windows) or Command+Shift+F (Macintosh).

To set options for the Flash formatting style, do the following:

1. Select Auto Format Options from the Actions panel pop-up menu.

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.

To use automatic indentation:

- Automatic indentation is turned on by default. To turn it off, deselect Automatic Indentation in ActionScript Editor preferences.

When automatic indentation is turned on, the text you type after `(` or `{` is automatically indented according to the Tab Size setting in ActionScript Editor preferences. To indent another line in the Script pane, select the line and press Tab. To remove the indent, press Shift+Tab.

To use punctuation balance:

1. Click between braces, brackets, or parentheses in your script.
2. Press Control+' (Windows) or Command+' (Macintosh) to highlight the text between braces, brackets, or parentheses.

The highlighting helps you check whether opening punctuation has correct corresponding closing punctuation.

To display code hints:

Click the Show Code Hint button.

For more information about code hints, see Using code hints. To change Flash preferences so that code hints always appear, see Setting Actions panel preferences in Using Flash.