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

Hour 13. Making Buttons for Your User to Click > Task: Make an Invisible Button

Task: Make an Invisible Button

Select Insert, New Symbol, name the symbol Invisible, click Button Behavior, and then click OK. This takes us to the master version of the symbol we're creating. Flash expects us to draw something here in the master version of the Invisible button symbol.

Leave all the frames of this button blank, but in the Hit frame insert a keyframe. (Because the previous keyframe is blank, this is the same as inserting a blank keyframe.)

Draw a circle around the center (the plus) in the Hit frame (to center it, you can draw a circle and then cut and paste or use the Info panel to set the center to 0, 0). Your button's Timeline should resemble Figure 13.10.

Figure 13.10. An invisible button looks like this— nothing in any frame except the Hit frame.

We're done here; just go back to your main scene and drag an instance of this Invisible button from the Library to the Stage. Check it out; it's blue. Now, test the movie, and you'll see nothing (except your cursor change when it reaches the button's location).

In the main scene, draw a large box and then a few circles in different locations on the box (as shown in Figure 13.11). Imagine that this box is a large map and each circle indicates a city. Then drag an invisible button from the Library for each circle you drew. Line up the buttons and scale them appropriately to cover each circle.

Figure 13.11. Invisible buttons can be placed on top of any drawing.

For something you can't even see, invisible buttons are actually quite powerful. It's safe to say I've never done a project without them. The main advantage is they keep the visual elements separate from the button's functionality. You can place invisible buttons on top of anything to effectively create a button the user can see and click. In Hour 22, “Working on Large Projects and in Team Environments,” you'll learn how such code-data separation can make you more efficient. For now, just realize that invisible buttons (or any buttons for that matter) won't do anything until you attach Actions to them.



Not a subscriber?

Start A Free Trial

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