Choosing a Scripting Mode

I l @ ve RuBoard

Flash offers two modes for scripting in the Actions panel: Normal and Expert. Normal mode offers you the highest level of assistance with the complex task of scripting. The following exercises teach you how to switch modes. But after completing this practice session, unless you are directed otherwise , keep the Actions panel set to Normal mode for the exercises in this book.

Only Experts Make Mistakes

Because Normal mode is for les experienced scripters, it does everything it can to ensure that the scripts you create are entered correctly and ready to run.

Therefore, in Normal mode, any scripts that you import from an external source (such as a text editor) must be in perfect shape. If the script contains any errors of syntax, a dialog box appears, warning you that you must import the script in Expert mode. In Expert mode, you are free to make as many mistakes as you like; Flash highlights the errors in red for you to fix.

To set the Actions panel to Normal mode:

  • In the Actions panel, from the Options menu in the top-right corner, choose Normal Mode.

    or

  • In the Actions panel, from the View Options pop-up menu, choose Normal Mode (Figure 12.3).

    Figure 12.3. The View Options pop-up menu gives you fast access to the two scripting modes.

    graphics/12fig03.gif

To set the Actions panel to Expert mode:

  • In the Actions panel, from the Options menu in the top-right corner, choose Expert Mode.

    or

  • In the Actions panel, from the View Options pop-up menu, choose Expert Mode.

graphics/01icon02.gif Tip

  • The Options menu in the top-right corner of the Actions panel lists keyboard shortcuts for switching between Normal and Expert modes. These shortcuts are available only when you have actually selected something in the Actions Toolbox.


Normal and Expert Modes Compared

In Normal mode, when you choose actions in the Actions Toolbox, information about the action appears in the parameters area of the Actions panel; in the Script pane, and in the line-by-line display below the Script pane. If you have selected Show Tooltips in the General tab of the Preferences dialog box, you will also see tooltips information when you position the pointer over an action or category in the Actions Toolbox.

In Normal mode, Flash helps you complete action statements that require parameters that the scripter must supply. When you select such an action in the Script pane, Flash displays text fields for entering any parameters associated with that action (Figure 12.4). (If there are no parameters for a selected action, Flash lets you know that, too.) This method of completing the action statements makes it easier to know when parameters must be entered. Flash takes the information you provide in the parameters area and places it in the script, using the correct ActionScript syntax.

Figure 12.4. The Actions Toolbox presents different options in Normal and Expert mode. In Normal mode (left), the stop and play parameters that complete the goto action appear in the parameters area along with the other parameters that direct Flash to a new location. Flash helps you fill in these parameters accurately in the script. In Expert mode (right), you must select the action you want ( gotoAndPlay or gotoAndStop ) and complete its parameters yourself.

graphics/12fig04.gif

In Expert mode, you can choose actions from the Actions Toolbox or simply type them in the Script pane. In this mode, you must enter any required parameters yourself.

Both Normal and Expert modes let you use code hinting. Code hints prompt you to fill in parameters and properties in the correct syntax; in Expert mode, code hints also help you with the scripting for events. The hints appear as tooltips or pop-up menus .

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