Adobe InDesign CC
You can create buttons that perform an action when the document is exported to SWF or PDF 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
Use the Buttons panel to make the buttons interactive. When a user clicks a button in the exported SWF or PDF file, an action is performed. See Make buttons interactive.
Use the Appearance section of the Buttons panel to define the appearance the button takes in response to certain mouse actions. See Change button appearance for rollover and clicking.
Use the Object States panel to create multi-state objects. See Create multi-state objects.
Create a “hot spot” or “hot link” effect that displays an image when the button is moused over or clicked. See Create button hot spots.
When working on buttons and designing dynamic documents, select the Interactivity workspace.
- 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.”
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.
- 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 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 PDF or SWF file. See Change button appearance for rollover and clicking.
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.
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 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.
Use the Preview panel to test the button.
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.
Make buttons interactive
You can create, edit, and manage interactive effects in InDesign. When the document is exported to Adobe 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.
This button is set to play a sound when the mouse button is released.
Some actions are supported in both PDF and SWF files, and some actions are supported only in PDF or SWF. When choosing an action, avoid choosing a PDF-only action if you’re exporting to SWF or a SWF-only action if you’re exporting to PDF.
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.
To test the button, export the document to 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.
Events determine how actions are activated in buttons when the document is exported to Adobe PDF or SWF. (In Acrobat, events are called triggers.)
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.
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.
When the button in a PDF file receives focus, either through a mouse action or pressing the Tab key.
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 PDF or SWF file. Select an option from the Zoom menu to determine how the page is displayed.
Toggles between showing and hiding specified buttons in the exported 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.
Lets you play, pause, stop, or resume the selected movie. Only movies that have been added to the document appear in the Video menu.
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.
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 State (SWF)
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)
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.
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.
If you set a hyperlink destination to a button, the hyperlink will have no effect in the exported PDF or SWF document.
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.
A. Pointer not over button area (Normal) B. Pointer enters button area (Rollover) C. Pointer clicks (Click)
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.
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.
- 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 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.
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.
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.
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.
In the exported PDF file, holding the pointer over a hot spot causes an image to appear.
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.
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.
- 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.
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.