Touring the Actions Panel

I l @ ve RuBoard

The Actions panel is a whole scripting environment in a box. It is filled with windows , buttons , fields, and message areas. The two items that dominate the panel are the Actions Toolbox and the Script pane.

The Actions Toolbox contains most of the "words" (actions) that make up the ActionScript language; these snippets of code appear in lists that are arranged hierarchically under folderlike category icons. The Script pane is a text window where you assemble your scripts.

The Actions panel has two scripting modes: Normal and Expert. In both modes, you can choose actions from the Actions Toolbox or the Add pop-up menu. Both modes let you import scripts or pieces of scripts from an external file, such as one created with a stand-alone text editor. In addition, in Expert mode, you can use the Script pane as a text editor and enter scripts manually.

Figure 12.1 shows the various elements of the Actions panel in Normal mode.

Figure 12.1. The Actions panel offers two modes for entering ActionScripts. Normal mode (shown) gives you the most assistance. Expert mode allows you to type scripts directly in the Script pane; this method can be much faster for users who become familiar with the ActionScripting language. The Actions-Frame panel in Normal mode has three main areas: the Actions Toolbox, where you choose actions; the Script pane, where Flash assembles the ActionScript; and the parameters area, where Flash presents items that require you to fill in more information.

graphics/12fig01.gif

To access the Actions panel:

If the Actions panel is not active, do one of the following:

  • From the Window menu, choose Actions (Figure 12.2).

    Figure 12.2. Choose Window > Actions to access the Actions panel. When you select a frame in the Timeline, the panel's title bar indicates that you are creating a script for the selected frame.

    graphics/12fig02.gif

  • Press F9.

  • In the Timeline, Control-click (Mac) or right-click (Windows) a frame, and choose Actions from the contextual menu for frames .

    The Actions-Frame panel opens.

Two Types of Actions

Flash uses two basic types of scripts: scripts that at ach to frames and scripts that at ach to objects.

Frame-based scripts are sets of actions at ached to a keyframe. They require no input from the person watching your movie. In the final exported movie, when the playhead reaches a frame that contains a script, Flash carries out the script's instructions.

Object-based scripts are sets of actions at ached to buttons or movie clips. Actions attached to buttons require input from someone who is viewing the movie. In a text-heavy frame, for example, you could make Flash pause the movie until the user clicks a button that instructs Flash to resume playback.

Actions attached to movie clips can also respond to user input. If your text-heavy frame contains a movie clip, for example, you could at ach an action to the movie clip that pauses playback until the user clicks anywhere in the same frame. Movie-clip actions can also be triggered without user intervention. You might, for example, have Flash stop playing all sounds when a movie clip first appears. At aching that action to the movie clip instead of the frame containing the movie clip lets you tie the soundtrack more precisely to the movie clip's appearance.

In addition, advanced ActionScripters can create scripts that target text fields, performing operations that modify them or retrieve information from them. Text fields on their own, however, cannot have attached scripts.

graphics/01icon02.gif Tips

  • The Actions panel's title bar reveals what type of item the script you are creating will attach to: a frame, movie clip, or button. If, while working on a script for the current frame, you happened to click a movie clip or button on the Stage, the title bar changes. To return to the Actions panel for frames, click the frame in the Timeline, or click an empty area of the Stage or work area. You learn about at aching scripts to movie clips and buttons in Chapter 13.

  • To prevent Flash from displaying or starting a different script as you click different items, you can pin a script. Pinning forces Flash to continue displaying the pinned script even if you select a different frame or object. Pinning allows you to examine a variety of elements and situations in your movie as you create your scripts. To pin a script, choose the script from the Jump menu, or select the frame or object that the script is at ached to (which makes the script active in the Script pane). Now click the pushpin icon in the top-right corner of the Actions panel. The icon changes to a more upright version of a pushpin. When you're ready to view other scripts, click the upright-pushpin icon.


To close the Actions panel:

  • Repeat any of the actions in the preceding exercise.

    or

  • Click the Actions panel's close box (Mac OS 9 and Windows) or close button (Mac OS X).

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