Create buttons

You can create buttons that perform an action when the document is exported to fixed layout EPUB, PDF, or SWF format. For example, you can create a button that jumps to a different page or opens a website.

Button set up to play movie in exported PDF
Button set up to play movie in exported PDF

When you create a button, you can do the following:

Note:

When working on buttons and designing dynamic documents, select the Interactivity workspace.

Create a button

  1. Use the Pen tool or a drawing tool, such as the Rectangle tool or Ellipse tool, to draw the button shape. If necessary, use the Type tool to add text to the button, such as “Next” or “Purchase.”

    Note:

    If you’re creating navigation buttons (such as Next Page or Previous Page) that appear on multiple pages, add them to a master page so that you don’t have to re-create buttons on every document page. These buttons appear on all document pages to which the master is applied.

  2. Use the Selection tool  to select the image, shape, or text frame that you want to convert.

    You cannot convert a movie, sound, or poster to a button.

  3. Click the Convert Object To A Button icon  in the Buttons panel (choose Window > Interactive > Buttons). Or, choose Object > Interactive > Convert to Button.
  4. In the Buttons panel, do any of the following:
    • In the Name text box, specify a name for the button to distinguish it from other buttons you create.
    • Specify one or more actions for the button to determine what happens when the button is clicked in the exported fixed layout EPUB, PDF, or SWF file. See Make buttons interactive.
    • Activate additional appearance states and change their appearance to determine what the button looks like when you use the mouse to roll over the button or click it in the exported fixed layout EPUB, PDF, or SWF file. See Change button appearance for rollover and clicking.
  5. Use the Preview panel (Window > Interactive > EPUB Interactivity Preview / SWF Preview) to test the button before you export the document to interactive fixed layout EPUB, PDF, or SWF.

Add a button from the Sample Buttons panel

The Sample Buttons panel includes a number of pre-created buttons that you can drag into your document. These sample buttons include effects such as gradient feathers and drop shadows, with a slightly different appearance for the Rollover appearance. The sample buttons are also assigned actions. For example, the sample arrow buttons are preset with Go To Next Page or Go To Previous Page actions. You can edit these buttons to suit your needs.

The Sample Buttons panel is an object library. As with any object library, you can add buttons to the panel and remove ones you don’t want to use. (See Use object libraries.) The sample buttons are stored in the ButtonLibrary.indl file, which is located in the Presets/Button Library folder in the InDesign application folder.

  1. Choose Sample Buttons from the Buttons panel menu to open the Sample Buttons panel.
  2. Drag a button from the Sample Buttons panel to the document. If you want navigation buttons to appear on every page, add the buttons to a master page.
  3. Select the button using the Selection tool, and then edit the button as necessary using the Buttons panel.

While editing the sample buttons, keep the following in mind:

  • If you add text to a button, remember to copy and paste the text from the Normal button state to the Rollover button state. Otherwise, the text you add does not appear when the mouse rolls over the button in the fixed layout EPUB, PDF, or SWF file.

  • You can resize buttons. If you drag a pair of Next Page/Previous Page arrow buttons, resize the first button, and then select the second button, and choose Object > Transform Again > Transform Again.

Note:

Use the Preview panel to test the button.

Convert a button to an object

When you convert a button to an object, the contents of the button remain on the page without the button properties. Any content associated with the button’s other states are also removed.

  1. Use the Selection tool  to select the button.
  2. Choose Object > Interactive > Convert To Object.

Make buttons interactive

You can create, edit, and manage interactive effects in InDesign. When the document is exported to fixed layout EPUB, PDF, or SWF, these interactive actions can be active.

For example, suppose you want to create a button that causes a sound to play in a PDF document. You can place the sound file in an InDesign document, and then create a button that causes the sound to play when you click the button in the PDF document.

In this example, clicking the mouse button is the event, and playing the sound is the action.

Button is set to play a sound
This button is set to play a sound when the mouse button is released.

Note:

Some actions are supported in PDF and SWF/EPUB files, and some actions are supported only in PDF or SWF/EPUB. When choosing an action, avoid choosing a PDF-only action if you’re exporting to SWF or fixed layout EPUB. Also, avoid choosing a SWF/EPUB-only action if you’re exporting to PDF.

Add actions to buttons

You can assign actions to different events. For example, in an exported PDF file, you can specify a sound to play when the mouse pointer enters the button area, and a movie to play when the mouse button is clicked and released. You can also assign multiple actions to the same event. For example, you can create an action that plays a movie and sets the view zoom to Actual Size.

  1. Use the Selection tool  to select the button you created.
  2. In the Buttons panel, choose an event, such as On Release, that determines how actions are activated.
  3. Click the plus sign button  next to Actions, and choose the action to assign to the event.
  4. Specify the settings of the action.

    For example, if you choose Go To First Page, specify the zoom. If you choose Go To URL, specify the web page address. Some actions, such as Go To Next View, do not have additional settings.

  5. If necessary, continue to add as many actions as needed to any event.

Note:

To test the button, export the document to fixed layout EPUB, PDF or SWF, and view the exported file. If you’re exporting to PDF, make sure that the Interactive Elements option is selected. If you’re exporting to SWF, make sure that Include Buttons is selected.

Event types

Events determine how actions are activated in buttons when the document is exported to EPUB, PDF, or SWF. (In Acrobat, events are called triggers.)

On Release

When the mouse button is released after a click. This is the most commonly used event, because it gives the user one last chance to drag the cursor off the button and not activate the action.

On Click

When the mouse button is clicked (without being released). Unless you have a specific reason for using On Click, it’s preferable to use On Release so that users have a chance to cancel the action.

On Roll Over

When the mouse pointer enters the button area defined by the button’s bounding box.

On Roll Off

When the mouse pointer exits the button area.

On Focus

When the button in a PDF file receives focus, either through a mouse action or pressing the Tab key.

On Blur

When the focus moves to a different button or form field in the PDF file.

Action types

When you create an action, you indicate what happens when the specified event occurs—usually when someone clicks the button. You can assign the following actions to occur when the event type is activated:

Go To Destination

Jumps to the specified text anchor created using the Bookmarks or Hyperlinks panel. See Create jumps to text anchors.

Go To First/Last/Next/Previous Page

Jumps to the first, last, previous, or next page in the fixed layout EPUB, PDF, or SWF file. Select an option from the Zoom menu to determine how the page is displayed.

Go To URL

Opens the web page of the specified URL.

Show/Hide Buttons

Toggles between showing and hiding specified buttons in the exported fixed layout EPUB, PDF, or SWF file. For example, if you want one button to appear when another button is moused over, you can hide the target button until it’s triggered and create an action that displays the hidden button on rollover. See Display a different button on rollover.

Video

Lets you play, pause, stop, or resume the selected movie. Only movies that have been added to the document appear in the Video menu.

Sound

Lets you play, pause, stop, or resume the selected sound clip. Only sound clips that have been added to the document appear in the Sound menu.

Animation (SWF/EPUB)

Lets you play, pause, stop, or resume to selected animation. Only animations that have been added to the document appear in the Animation menu.

Go To Page (SWF/EPUB)

Jumps to the page in the SWF file you specify.

Go To State (SWF/EPUB)

Jumps to a specific state in a multi-state object. For example, if a multi-state object includes several different images as states, you can use this action to display a particular image.

Go To Next/Previous State (SWF/EPUB)

Jumps to the next or previous state in a multi-state object. These options are especially useful for clicking through a slideshow. See Create multi-state objects.

Go To Next View (PDF)

Jumps to a page after going to the previous view. In the same way that a Forward button is available in a web browser only after someone clicks the Back button, this option is available only if the user has jumped to a previous view.

Go To Previous View (PDF)

Jumps to the most recently viewed page in the PDF document, or returns to the last used zoom size.

Open File (PDF)

Launches and opens the file that you specify. If you specify a file that is not PDF, the reader needs the native application to open it successfully. Specify an absolute pathname (such as C:\docs\sample.pdf).

View Zoom (PDF)

Displays the page according to the zoom option you specify. You can change the page zoom level (such as Actual Size), the page layout (such as Continuous - Facing), or the rotation orientation.

Edit or delete button actions

  1. Use the Selection tool  to select the button.
  2. In the Buttons panel, do any of the following:
    • To deactivate actions, deselect the check box next to the item. Deactivating events and actions can be useful for testing purposes.
    • To change the order, drag and drop actions.
    • To delete an action, select the action in the list box, and click the Delete Selected Action button .
    • To edit an action, choose the event to which the action is assigned, select the action in the list box, and change the settings. If you need to replace a action for an existing event, delete the action, and then add the new action to the event.

Create jumps to text anchors

If you create a text anchor in an InDesign document, you can cause a button to jump to that anchor, even if it’s in another InDesign document. Use the Bookmarks panel and Hyperlinks panel to add text anchors. You cannot create jumps from buttons to bookmarks that aren’t text anchors.

Note:

If you set a hyperlink destination to a button, the hyperlink will have no effect in the exported fixed layout EPUB, PDF, or SWF document.

  1. Use the Selection tool  to select the button.
  2. In the Buttons panel, choose the event such as On Release that will trigger the jump.
  3. Click the plus sign button next to Actions, and choose Go To Destination.
  4. Select one of the open InDesign documents from the Documents menu, or click the folder icon to the right of the menu and specify the file.
  5. Specify an anchor that was created using the Bookmarks panel or Hyperlinks panel.
  6. Select an option from the Zoom menu to determine how the page is displayed.

Note:

If you specify an anchor in a different document, remember to export that target document to PDF, and use the same filename as the InDesign document, replacing the INDD extension with PDF. Also, store the PDF documents in the same folder to make sure that the links remain valid in Acrobat and Reader.

Change button appearance for rollover and clicking

A button consists of a group of individual objects that each represent a button appearance (sometimes called a “state”). Each button can have as many as three appearances: Normal, Rollover, and Click. In the exported file, the Normal appearance is used unless the mouse pointer moves into the area (Rollover) or the mouse button is clicked on the button area (Click). You can make each appearance different to provide visual feedback.

By default, any button you create is defined with the Normal appearance containing the button’s text or image. When you activate a new appearance, the Normal appearance is copied. To distinguish an appearance from the others, you can change the color or add text or an image.

Button states
Button states

A. Pointer not over button area (Normal) B. Pointer enters button area (Rollover) C. Pointer clicks (Click) 

Note:

The clickable area, or hot spot, of the button is the square bounding box of the largest state in the button. For example, a round button has a square hot spot.

Change button appearances

If you’re creating a button with multiple appearances (Normal, Rollover, and Click), it’s a good idea to finish designing the button before you activate other appearances. When you activate the Rollover or Click appearance, the Normal appearance is copied.

Some changes affect only the selected appearances, while other changes affect all active appearances. If you select an appearance and apply a different background color or edit the text, the change affects only the selected appearance. If you use the Selection tool to move or resize the button, the change affects all appearances.

  1. Choose Window > Interactive > Buttons to display the Buttons panel.
  2. Using the Selection tool , select the button in the layout that you want to edit.
  3. Click [Rollover] to activate the Rollover appearance.

    The Normal appearance is copied to Rollover.

  4. With Rollover still selected, change the appearance of the button.
    • To change the color, choose a swatch from the Stroke or Fill menu in the Control panel.
    • To place an image in the appearance, select the existing image by using the direct selection tool or double-clicking the existing button image, and then choose File > Place and double-click a file.
    • To paste an image into a text frame, copy it to the Clipboard, select the appearance in the Buttons panel, and then choose Edit > Paste Into.
    • To type text, select the Type tool, click the button, and type the text. You can also choose Edit > Paste Into to copy a pasted text frame.
  5. To add the Click appearance, click [Click] to activate it, and then follow the same procedure to change its appearance.
  6. Use the Preview panel to test the different button appearances.

Note:

To change the size of the State Appearance thumbnails in the Buttons panel, choose Panel Options from the Buttons panel menu, select an option, and then click OK.

Delete and disable appearances

  1. Select the appearance in the Buttons panel.
  2. Do any of the following:
    • To delete the Rollover or Click appearance, click the Delete icon at the bottom of the panel. Deleting an appearance is especially useful if you edit the Normal appearance extensively and decide you want to base Rollover or Click on the new Normal appearance.
    • To disable an appearance without deleting it, click the Eye icon next to the appearance to deselect it. Disabled states are not exported to the fixed layout EPUB, PDF, or SWF file.

Note:

You cannot delete or disable the Normal state.

Create multi-state objects

The Object States panel lets you create multiple versions of an object. A state is a version of a page item. An object that includes multiple states is called a multi-state object.

With the Object States panel, there is no limit to the number of states you can create for an object. Each time you create a state, you generate another version of your page item. Only one state is visible on the page at a time. For print and PDF output, only the active state appears in the final output.

Create a multi-state object slide show

One of the most common uses for a multi-state object is a slide show that lets viewers of a SWF file click through a set of images. For example, you can create a slide show of 20 images without having to place the images on 20 different pages.

  1. Place the images that will appear in the slide show.

    For best results, make sure that the image frames are the same size.

    A state does not have to be a single item—it can be a collection of items.

  2. To stack the images, select them, and click Align Horizontal Centers  and Align Vertical Centers  in the Control panel.

  3. With the images still selected, open the States panel (Window > Interactive > Object States), and click the Convert Selection To Multi-State Object button .

    The images appear as states in the Object States panel, and a dashed frame borders the selected images.

  4. Create navigation buttons that trigger the Go To Next State and Go To Previous State actions when the mouse button is release. See Create buttons.

  5. Use the Preview panel (Window > Interactive > EPUB Interactivity Preview / SWF Preview) to test the navigation buttons.

  6. Export the document to SWF format. See Interactive documents.

Edit a multi-state object

  1. Select a multi-state object.

  2. In the Object States panel, do any of the following:

    • To edit a state, select the state in the Object States panel, and then edit the object. For example, you can add a stroke or fill or resize the object.

    • To add an object to an existing state, select both the object and the multi-state object, and then click the Add Objects To Visible State button .

    • To add an object to an existing multi-state object, select both the object and the multi-state object, and then click the Convert Selection To Multi-State Object button .

    • To duplicate a state, select a state to base the new state on, and choose New State from the panel menu. Add, remove, or edit the content of that state.

    • To paste objects into an existing state, cut or copy one or more objects, select the multi-state object, select the state in the Object States panel, and choose Paste Into State from the Object States panel menu.

    • To convert a multi-state object back to a set of independent objects, select the state in the Object States panel and choose Release State To Object from the panel menu. To convert all states in the multi-state object to objects, choose Release All States To Objects.

    • To delete a state and remove its contents, select the state and choose Delete State from the panel menu.

    • To hide the multi-state object in the exported file until it’s triggered by a button, choose Hide Until Triggered from the panel menu.

    • To reset all multi-state objects in the document to the first state, choose Reset All Multi-State Objects To First State from the panel menu. When you select a state, the object remains in that state, even if you close and reopen the document. This option is a quick way to reset all the multi-state objects.

Create button hot spots

In some cases, you may want the button area (called a “hot spot” or “hot link”) to be invisible until the mouse pointer hovers over it. For example, when you move a pointer over a button on a map, an image could be displayed that represents a region, and the image could disappear when the pointer moves away from the region.

Holding the pointer over a hot spot in an exported PDF file
In the exported PDF file, holding the pointer over a hot spot causes an image to appear.

Display a hidden image on rollover

One way to achieve a “hot spot” effect is to apply an image to the Rollover state in the Buttons panel. To do this, create a button in which the [Rollover] state displays an image while the [Normal] state doesn’t display the image.

  1. Select the image you want to use as a hot spot. Make sure the frame of the image does not have a border or background.

  2. In the Buttons panel (choose Window > Interactive > Buttons), click the [Normal] appearance to convert the selected image to a button.

  3. Click the [Rollover] appearance in the Buttons panel to activate it.

  4. Click the [Normal] appearance again. Then select the image using the Direct Selection tool  and delete the image.

    Make sure you delete the image (the contents of the frame), not the frame and contents. Deleting the frame deletes the entire button.

  5. Use the Preview panel to preview the hot spot effect.

Display a different button on rollover

You can create a hot spot in which clicking or mousing over an object displays another object. To do this, create two buttons, hide one of the buttons, and use the Show/Hide Button action to show and hide the target button.

  1. Create an object to be used as the source button. In the Buttons panel, click the Convert Object To A Button icon.
  2. Place the image you want to be used as the target button, and convert it to a button.
  3. Select the target image and select Hidden Until Triggered at the bottom of the Buttons panel.

    The image needs to be hidden in the exported document so that it can be displayed when the source button is moused over or clicked.

  4. Select the source button and create two different actions, one to show the target image and a second to hide the target image.

    If you want the image to appear when the mouse hovers over the source button, use the On Roll Over and On Roll Off events. If you want the image to appear when you click the source button and disappear when you release it, use the On Click and On Release events. In either case, use the Show/Hide Buttons action to display and hide the target button. See Make buttons interactive.

  5. Use the Preview panel to test the buttons.

Changing PDF options for buttons

  1. Use the Selection tool  to select the button.
  2. From the Buttons panel menu, choose PDF Options.
  3. Type a description that acts as alternative text for visually impaired users.
  4. Indicate whether the button should be printed in the PDF file, and then click OK.

Set the button tab order

The tab order determines the next (or previous) field to receive focus when a user presses Tab (or Shift+Tab) in the PDF or SWF document. The tab order includes buttons on hidden layers, but not buttons on master pages.

  1. Go to the page containing the buttons.
  2. Choose Object > Interactive > Set Tab Order.
  3. Select each button you want to move and drag it to its new position, or click the Move Up and Move Down buttons. When you’re done, click OK.

If you use Acrobat to edit the PDF and add more buttons or form fields to the page, you may need to specify a new tab order in Acrobat.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy