• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 13. Interactivity with Objects > Creating an Invisible Button

Creating an Invisible Button

You don't actually have to place a graphic in every frame of a button. The only frame that must have content is the Hit frame, because it describes the active button area. Buttons without content in the Up frame are invisible in the final movie. A common use for an invisible button is to resume playback of a movie that pauses on a frame that contains lots of text. Make an invisible button with a Hit-frame graphic that covers the whole Stage, and give the button a play action; then place the button in the paused movie frame. When viewers finish reading your text, they can click anywhere in the frame to resume playback of the movie.

To create an invisible button:

Create a new Flash document with keyframes in the first two frames.

Using the text tool, place a long text block in Frame 1; place idengifying text in Frame 2 (Figure 13.29).

Figure 13.29. Your practice file should look something like this: a two-frame movie with lots of text in the first frame and a stop action in each frame.

Put a stop action in each frame so that the movie doesn't loop through the frames on playback.

With Frame 1 selected, choose Insert > New Symbol.

The Symbol Properties dialog box appears.

Choose Button in the Behavior section, type a name for your button, and click OK.

In symbol-editing mode, in the Timeline for your button, select the Hit frame.

Choose Insert > Blank Keyframe.

Use the rectangle tool to create a filled rectangle large enough to cover the entire Stage (Figure 13.30).

Figure 13.30. 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.

This 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.

Return to movie-editing mode, and drag a copy of your button to the Stage.

Flash shows a transparent object that previews the hot-spot area. If necessary, you can reposition (or resize) the button so that it fully covers the Stage (Figure 13.31).

Figure 13.31. 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 movie-editing mode.

On the Stage, select the hot-spot preview.

Access the Object Actions panel.

Assign a play action to your button instance (as described in "Adding Actions to Buttons" earlier in this chapter).

You're ready to see the button in action.

Choose Control > Test Movie.

Flash exports the movie and opens it in Flash Player. Playback pauses on Frame 1—the one with lots of text (Figure 13.32). But as soon as you click within the current frame in the Player window, Flash moves on to Frame 2.

Figure 13.32. This movie is paused on a frame with a stop action and an invisible button that covers the entire frame. The index-finger pointer indicates the presence of the button. Clicking takes the user to the second frame.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint