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

Chapter 4. Creating an Interactive Map > Adding Action to the Buttons

Adding Action to the Buttons

The final stage of button building is adding the actions. Actions are activities that are produced in the program in response to some event generated by the user, such as clicking a button or link, or by the program, such as displaying a page. Although you can add actions to individual buttons as you build them, there isn’t much value to doing that in a project like this because you need to see the button names when configuring the actions—it’s hard to select a name for a button that hasn’t been built!

The only buttons that need actions attached are the six hotspot buttons. Acrobat contains a number of mouse actions that apply to buttons. Buttons can produce different actions based on where the pointer is in relation to the button or based on the mouse action itself. These mouse movements are called triggers.

As you’ll see shortly, there are a number of mouse actions you can choose in the Button Properties dialog, listed in the Select Trigger pull-down menu on the Actions tab of the dialog (Figure 4.16). These triggers include

Figure 4.16. Choose from one of several triggers that will initiate button actions.


  • Mouse Up—when the mouse button has been depressed and released

  • Mouse Down—when the mouse button is depressed

  • Mouse Enter—when the pointer moves over the button

  • Mouse Exit—when the pointer moves away from the button area

Note

There are other triggers used specifically for forms and media, such as the On Blur and On Focus triggers for form fields, and Page Visible/Invisible for media clips. Other document elements, such as pages, can also have triggers.


The most common button trigger is Mouse Up, and that is set as Acrobat’s default trigger. The action is initiated when the user clicks a button with the mouse and then releases the button. Since Amanda’s project uses images that appear and disappear in response to mouse actions, she’ll use separate actions attached to two triggers—the Mouse Enter and Mouse Exit triggers. First you apply an action to the Mouse Enter trigger, and then you repeat the process for the Mouse Exit trigger. Each trigger is a separate type of interaction, so each needs its own action.

Follow these steps to add the actions to the first hotspot button, b_cruise:

1.
Double-click the button with the Button tool to open the Button Properties dialog, and then select the Actions tab.

2.
To add the first action, click the Select Trigger pull-down arrow and choose Mouse Enter (the list is shown in Figure 4.16).

3.
Click the Select Action pull-down arrow and choose Show/hide field (Figure 4.17).

Figure 4.17. You can choose from a wide range of actions to apply to a button.


4.
Click the Add button—hidden beneath the pull-down list in Figure 4.17—and the Show/Hide a Field dialog shown in Figure 4.18 opens.

Figure 4.18. Select the field you want to show in response to the mouse action.


5.
Click the i_cruise field in the list, and click the Show radio button. Click OK to close the dialog and return to the Action tab of the Button Properties dialog.

6.
Click the Select Trigger pull-down arrow again, and choose Mouse Enter again.

7.
Click Add to open the Show/Hide Field dialog and choose the t_cruise field.

8.
Click the Show radio button—which means the field will become visible when the user mouses over the button—and then click OK to close the dialog and return to the Actions tab of the Button Properties dialog.

Each time you add an action, make sure to check the trigger shown on the Actions tab. It defaults to Mouse Up, so you have to repeat the selection of the trigger each time you add another action.

9.
Choose the Mouse Exit trigger from the Select Trigger pull-down list, and click Add to open the Show/Hide Field dialog.

10.
Select the i_cruise field; the Hide radio button is selected by default. Leave the default because you want the field to be hidden when the user mouses away from the button.

11.
Click OK to close the Show/Hide Field dialog and return to the Actions tab of the Button Properties dialog.

12.
Again, choose the Mouse Exit trigger from the Select Trigger pull-down list and click Add to open the Show/Hide Field dialog.

13.
Select the t_cruise field, and leave the default Hide radio button selected.

14.
Click OK to close the Show/Hide Field dialog and return to the Actions tab of the Button Properties dialog.

15.
To check that the actions are all recorded, read the listing in the Actions section of the dialog. You see four actions—two Mouse Enter and two Mouse Exit actions (Figure 4.19).

Figure 4.19. Each hotspot button uses a set of four actions to show and hide its corresponding pop-up images.


16.
Click Close to dismiss the Button Properties dialog.

Repeat the entire process with the remaining hotspot buttons in the project. When you have finished, click the Hand tool on the Basic toolbar to test the buttons. If you prefer, you can test each button as you add it. Move the pointer over a hot-spot button to show the image and its corresponding text; move the pointer away from a hotspot button and the images disappear (Figure 4.20).

Figure 4.20. The images appear and disappear depending on the pointer’s location on the document.


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