- Up until now, we have been focusing on building MSOs, but now it's time to add some buttons so that the users can navigate through the states. If every state of your MSO requires the same controls, the simplest way to accomplish that is by creating the buttons outside of the MSO. What do I mean by that? Let's take a quick look, and I think it'll become a little bit more clear. First, let's take a look at the file. It's called external controls. It's in your Exercise Files.
But, I've got three layers set up here. Let's just take a look at them. One is this background layer that just has my static content. That's this background here. I've got a layer that I want to use for an MSO, and it's got some text frames. You can see it's rather difficult to read because they're sitting on top of one another. I've got one for my buttons. Now, I want to create the MSO out of this content first. I think the easiest way to do that is just come on over to the layer and Option+click it.
It's gonna select everything that I've got on that layer. I'm going to close up the Layers panel now, and open up the Object States panel. Let's just come on down here to this familiar button to convert that selection to a multi-state object. Just click that. Sure enough, I've got my MSO. Let's just take a look at this though. I've got a Top 5 for San Francisco. I'm going to have to rename these states if I want them to be a little more clear, but I can click through them right now just to see what we've got here.
So far, so good. They're in the right order. That one is not. That's number five, so let's drag that down to the bottom. Let's come up here. This should be number three. Now, I think they're in the right order. Five, four, three, two, and one. Now, I could rename these, but for this exercise we'll just go ahead and leave these at the default. Let's just close this back up now. Now, I want to add some buttons to control this.
I've got two buttons here for Next and Previous. Those are just a couple of polygons that I drew out. I want to convert these to buttons, so I'm going to Shift+click to select them both. Let's just open up our Buttons and Forms panel. I'm going to come on down here to this bottom button that says Convert to Button. I will click on that. Now, I've got two buttons. I'm just going to close this up for a second. I just want to get this one button.
Let's just deselect everything by clicking outside the area, and let's select this one. Open up the Buttons and Forms panel. Now, I can just add the action I want here. I want this to go to the next state. I just want the user to be able to toggle through here. I don't need them to go to a specific spot. So, let's just click the plus button here. Remember, I highlighted these, so that they'd be easy to spot. Here's why. I'm going to click on Go To Next State.
There's only one MSO on this page. You can see, when I click on here, it's just this one. I didn't bother to rename it before, so it just has its default name of Multi-state 3. Let's come on over here, and get the other one. We'll do the same thing here, but we're gonna have Go to Previous State this time. Now, it's time to test this out and see how it's going to work. Let's come on down here, to the bottom of the Buttons and Forms panel. Let me pull this up here.
See I've got this little preview button here. If I just click on this, it's going to open up the EPUB Interactivity Preview panel. Let's just click that, and see what we get. InDesign has generated the HTML for that. We're going to open up this panel a little bit, so that you can see what we've got here. I'll just center it. I've got the two buttons, and as I drag my cursor over, you can see that it changes from an arrow to a hand. That gives me a visual cue that I can click on that area.
Let's click on the Next button. Sure enough, number two, three, four, and five. If I click again, it's going to take me to the beginning. The previous button, that one works, too. That's it! You're done creating all the navigation you'll need for a simple, multi-state object. Now, of course it's not always that simple. We'll get to that soon enough.
- Working with the Object States panel
- Creating content for basic multistate objects (MSOs)
- Using layers and pages to create MSOs
- Adding and removing states
- Adding content
- Adding objects as states
- Controlling MSOs with buttons
- Using MSOs for interactive content
- Nesting MSOs