Creating Invisible Button Symbols


The only frame of a button that must have content is the Hit frame, because it describes the active button area. Buttons without content in the Up, Over, and Down frames are invisible in the final movie. An invisible button with a Hit-frame graphic that covers the Stage allows users to click anywhere in the frame to trigger a button's actions.

To create an invisible button

1.

Open a new Flash document to which you want to add an invisible button.

2.

Choose Insert > New Symbol.

The Create New Symbol dialog appears.

3.

Name your button (for example, HiddenButton), choose Button in the Behavior section, and click OK.

4.

In symbol-editing mode, in the Timeline, select the Hit frame of the button, and choose Insert > Timeline > Blank Keyframe.

Flash creates a blank keyframe for the button's Hit frame.

5.

On the Stage, create a graphic element to represent the active button area.

To create an invisible button that allows users to click anywhere to trigger an action, draw a filled rectangle large enough to cover the Stage (Figure 12.16). The solid rectangle turns the whole Stage into an active button, but because no graphics are associated with the button, it will be invisible to the user.

Figure 12.16. To make an invisible button, create a button symbol that has nothing in the Up, Over, and Down frames. Here, the Hit frame contains a filled rectangle large enough to cover the Stage.


6.

Return to document-editing mode, and drag a copy of the HiddenButton symbol to the Stage.

Flash displays a transparent version of the Hit-frame graphic, which indicates the hot-spot area of the invisible button (Figure 12.17). If necessary, you can reposition (or resize) the button so it covers the Stage fully.

Figure 12.17. When the Up frame of a symbol is empty, Flash displays a transparent version of the Hit-frame graphic to help you position your invisible button in document-editing mode.


Tip

  • In symbol-editing mode, the Stage is a fixed size (roughly 25.5 inches by 27.5 inches or 1990 pixels by 1990 pixels), and it's not necessarily the same size as the Stage in your current movie. To ensure that the Hit-frame rectangle of an invisible button covers the whole Stage, select the rectangle; then, in the Info panel or the Properties tab of the Property inspector, enter values in the Width and Height fields that are slightly larger than the dimensions of your document. Or, once you've created the invisible button, place an instance on the Stage, select it, and choose Edit > Edit in Place. You'll see the Stage in relation to the button's preview; you can then use the free-transform tool to resize the button, checking its coverage of the Stage by eye.





Macromedia Flash 8 for Windows & Macintosh Visual QuickStart Guide
Macromedia Flash 8 for Windows & Macintosh
ISBN: 0321349636
EAN: 2147483647
Year: 2005
Pages: 204

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