Use Script Assist to write ActionScript

To add an ActionScript 3.0 action to a Flash document, you must attach it to a frame. To add an ActionScript 2.0 (or earlier) action to a Flash document, attach it to a button or movie clip, or to a frame in the timeline.

For a video tutorial about Script Assist mode, see www.adobe.com/go/vid0131.

For a text tutorial about Script Assist mode, see Use Script Assist Mode on the Flash Tutorials page at www.adobe.com/go/learn_fl_tutorials.

Start Script Assist mode

  1. Select Window > Actions.
  2. In the Actions panel, click Script Assist .

    In Script Assist mode, the Actions panel changes in the following ways:

    • Add (+) functions differently in Script Assist mode. When you select an item from the Actions toolbox or the Add menu , the item is added after the currently selected text block.

    • Delete (-) lets you remove the current selection in the Script pane.

    • The up and down arrows let you move the current selection in the Script pane upward or downward within the code.

    • The Check Syntax , Auto Format , Show Code Hint , and Debug Options  buttons and menu items normally visible in the Actions panel are disabled, as they do not apply to Script Assist mode.

    • The Insert Target button  is disabled unless you are typing in a box. Clicking Insert Target places the resulting code in the current box.

Note: If the Actions panel contains ActionScript code when you click Script Assist, Flash compiles the code. If there are errors in the code, you cannot use Script Assist until you fix the current code selection. The errors are described in detail in the Compiler Errors panel.

View a description of an action

  • Click a category in the Actions toolbox to display the actions in that category, and click an action.
  • Select a line of code in the Script pane.

    The description appears at the top of the Actions panel.

Add an action to the Script pane

  • Click a category in the Actions toolbox to display the actions in that category, and then either double-click an action or drag it to the Script pane.
  • Click Add (+) and select an action from the pop‑up menu.
  • Press Escape and a shortcut key. (To view a list of shortcut keys, select Esc Shortcut Keys in the Actions panel pop‑up menu; select this option again to hide the list.)

Delete an action

  1. Select a statement in the Script pane.
  2. Click Delete (-) or press the Delete key.

Move a statement up or down in the Script pane

  1. Select a statement in the Script pane.
  2. Click the up or down arrow.

Work with parameters

  1. Add an action to, or select a statement in, the Script pane.

    Relevant parameter options appear above the Script pane.

  2. Enter values in the boxes above the Script pane.

Search for text in a script

  • To go to a specific line in a script, choose Go To Line from the Actions panel pop‑up menu or press Control+G (Windows) or Command+G (Macintosh); then enter the line number.
  • To find text, click Find , select Find from the Actions panel pop‑up menu, or press Control+F (Windows) or Command+F (Macintosh).
  • To find text again, press F3 or select Find Again from the Actions panel pop‑up menu.
  • To replace text, click Find, or press Control+H (Windows) or Command+H (Macintosh).

    In Script Assist mode, Replace searches and replaces text only in the parameter box of each action, not in the entire script. For example, in Script Assist mode you cannot replace all gotoAndPlay actions with gotoAndStop.

  This page on the Web