Creating Buttons on the Stage

   

Creating Buttons on the Stage

With the tools in the Tool palette, you can create working push buttons, check boxes, and radio buttons, along with the text that accompanies them ( Figure 9.24 ). For a description of each of these kinds of buttons, see the sidebar, "Button Types."

Figure 9.24. Use these tools to create push buttons, check boxes, and radio buttons for your movie.

graphics/09fig24.gif

When you play back your movie, you can click the buttons and they'll respond to your clicks (for example, an X will appear in a check box), but they won't actually do anything. In order for a button to accomplish a task, you have to assign a behavior to it (see Chapter 14, "Adding Behaviors") or attach a script to it (see Chapter 15, "Scripting Lingo").

Note that these buttons are fairly primitive graphically. They're based on the buttons used in early versions of the Mac operating systempure black and white, with none of the shading or 3D effects that are typical of present-day buttons. The push button, in particular, is probably too old-fashioned-looking to be useful. Instead, you'll probably want to create or import your own push-button cast members and attach a button behavior to them. (See Chapter 14, "Adding Behaviors.")

Button Types

A push button is what most of us have in mind when we simply refer to "a button" ( Figure 9.25 ). It's an object that may or may not look like a physical button, but it performs a specific action when clicked.

Figure 9.25. Add a push button to your movie if you want an action performed when a button is clicked.

graphics/09fig25.gif

Clicking a check box causes an X to appear in the center of the box. It's possible to select more than one check box in a group , so that any number (including all or none) of the boxes may end up with X 's in them ( Figure 9.26 ). Check boxes usually appear in groups, allowing a user to select any number of options, though a single check box may be used in a yes-or-no situation.

Figure 9.26. Add check boxes to your movie when you want users to select any number of options.

graphics/09fig26.gif

Radio buttons always occur in groups. Clicking a radio button causes a dot to appear in its center and causes the dot to disappear in any other buttons in the group. Thus, only one radio button can be chosen at a time ( Figure 9.27 ). Radio buttons require a user to make a single choice from among several options.

Figure 9.27. Add radio buttons to your movie when you want your users to choose only one option.

graphics/09fig27.gif

To create a button or check box:

  1. Depending on your preference, click the radio button, push button, or check box tool in the Tool palette.

  2. On the Stage, drag horizontally to create the button. Drag a rectangle big enough to contain not just the button but the text label that accompanies it ( Figure 9.28 ).

    Figure 9.28. Drag a rectangle big enough to hold not just the button but a text label as well.

    graphics/09fig28.gif

    Check boxes and radio buttons are always the same size no matter how far you drag. You can change the width of push buttons by dragging farther, but the height remains the same.

  3. Release the mouse button.

    A blinking insertion point appears at the place where the text label will go. If you're creating a push button, the insertion point is inside the button; if you're creating a check box or radio button, the insertion point is to the right.

  4. If you wish, select the font, size, and style for the text label: Choose Modify > Font and use the Font dialog box; alternatively, you can specify these text settings in the Text Inspector.

    For more information about each of these options, see Chapter 12, "Adding Text."

  5. Type the text ( Figure 9.29 ).

    Figure 9.29. Type the text that goes with the button.

    graphics/09fig29.gif

  6. If you need more room for the text, expand the rectangle by dragging the gray striped border that surrounds it.

    The text inside will automatically rewrap ( Figure 9.30 ).

    Figure 9.30. Resize the rectangle if necessary to accommodate the text.

    graphics/09fig30.gif

  7. Click outside the rectangle.

    The button and text become a sprite on the Stage and are added to the Cast window.

graphics/tick.gif Tip

  • To edit the text in a button, double-click it. The insertion point and gray border will reappear.


   


Macromedia Director MX for Windows and Macintosh. Visual QuickStart Guide
Macromedia Director MX for Windows and Macintosh. Visual QuickStart Guide
ISBN: 1847193439
EAN: N/A
Year: 2003
Pages: 139

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