Editing the Script

I l @ ve RuBoard

Flash plays the actions for a frame in the order in which they appear in the Script pane. The Up and Down buttons let you change the order of the actions that you've selected. The Delete button lets you remove actions from the script.

For these exercises, use the file that you created in the preceding exercise. Your movie should contain two scenes, each of which contains a bottom layer named Actions and a top layer named Content. Each Content layer contains keyframes in Frames 1 through 5. The Actions layer of Frame 1 of Scene 1 contains the following three lines of code:

 stopAllSounds ();  getURL ("");  stop (); 

To change the order of actions:

  1. In the Timeline for Scene 1, select Keyframe 1 of the Actions layer.

  2. In the first line of the Actions-Frame panel's Script pane, choose stopAllSounds (); .

  3. To send the action down one level in the Script pane, click the Down button.

    The stopAllSounds (); action is on Line 2 now.

  4. To send the action down another level in the Script pane, click the Down button again.

    The stopAllSounds (); action is on Line 3 now (Figure 12.16).

    Figure 12.16. The Up and Down buttons let you change the order of the actions in the script. Select an action and then click the Down button (top) to move the action down one line (middle). Click the Down button again to move the selected action again (bottom).

    graphics/12fig16.gif

graphics/01icon02.gif Tip

  • To reorder items in the Script pane quickly, click and drag the item you want to reposition it. The dog-eared page pointer appears, and you can scroll through the script to position the item.


To remove an action from the list:

  1. Continuing with the file that you created in the preceding exercises, in the Timeline for Scene 1, select Keyframe 1 in the Actions layer.

  2. In the Actions-Frame panel, in Line 2 in the Script pane, select the stop (); action.

  3. To remove the action from the Script pane, do one of the following:

    • Click the Delete button (the one with the minus sign).

    • Press Delete.

      The Script pane now contains just two actions (Figure 12.17).

      Figure 12.17. Click the Delete button (top) to remove the selected action from the list (bottom).

      graphics/12fig17.gif

graphics/01icon02.gif Tip

  • To remove a script from a frame, you must delete each line in the Script pane. To select the whole script quickly, click the first line of the script; Shift-click the last line of the script; then click the Delete button or press Delete.


ActionScript Dictionary at Your Fingertips

ActionScript is a complex language, and it has its own dictionary, which comes with Flash. This resource provides definitions of actions, as well as sample scripts that put the actions to work. You can access this dictionary from Flash's Help menu. The dictionary will open in a browser window, but you can also access the dictionary through Flash's Reference panel.

There are advantages to viewing the dictionary in the Reference panel. First, the dictionary is organized in the same categories and subcategories as the Actions Toolbox, so you can navigate quickly to the spot you want if you are already used to using that breakdown. Second, you can copy actions or chunks of sample scripts directly from the Reference panel. Select the actions you want to use, Control-click (Mac) or right-click (Windows) the selected text, and choose Copy from the contextual menu. To paste the selection into the Script pane of the Actions panel, Control-click (Mac) or right-click (Windows) the Script pane to access the contextual menu; then choose Paste. You can also use the standard keyboard commands for copying selected text from the Reference panel and pasting it into the Script pane in the Actions panel.

I l @ ve RuBoard


Macromedia Flash MX for Windows and Macintosh. Visual QuickStart Guide
Macromedia Flash MX 2004 for Windows and Macintosh (Visual QuickStart Guides)
ISBN: 0582851165
EAN: 2147483647
Year: 2002
Pages: 243

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net