- You're going to run into cases where one or more of the states in your MSO require different controls. One of the more common examples of that would be an MSO where you don't want a Go To Next State action on the last state, or a Go To Previous State action on the first state. Let's see how we can accomplish that by adding the buttons to the individual states while learning about some of the quirks that can arise. Okay, let's take a look at this file called "internal controls.indd" in your exercise files.
And we can see I've got an MSO here, and you can tell by that familiar dashed line around it, and I've got my two buttons. I'll open up the buttons in the Forms Panel so you can tell that this is a Go To Previous State action, this is a Go To Next State, you can see that changing up here in the actions area. So let's just close this up. Now, I only want a Go To Next State for state one, I only want a Go To Previous for number five, I don't want the others there.
So, let's treat the ones where gonna do the same first. I'm gonna open up my Object States Panel, let's go to state two, where I do want both of these buttons. So I'm gonna click on both on them and I'm gonna select the multi-state object, and, if you recall, there's just this little button down at the bottom that says "Add Objects to Visible State". So let's do that and see what happens. Good enough, so far so good, right? I've got my buttons in there.
One of the issues I'm gonna have here right away is if I select this button and I open up my Buttons and Forms Panel I've lost the action, it's gone. Conversely, if I select the other one it's also gone. The other problem I have here is if I select the MSO and go to the Object States Panel I don't have the buttons available to me anymore either, they've been placed into that state number two, and they're not really available anymore.
So, this is gonna get a little complicated so bear with me while we go through all of the steps we're gonna need to add this navigation to the MSO. So, I've got the buttons in here already and the first thing I wanna do is just add the action back into the button. I'm gonna select that Go To Next State button and I'm gonna open up the Buttons and Forms Panel, and I'm gonna click on the "+" button to add an action, and we'll say Go To Next State.
And then I'll just double-click the other button to select it, and we'll Go To Previous State. Now, I do not have to even worry about which MSO this is gonna control, because it's inside of an MSO it's only gonna control the one that it's available to it, and you can see even if I had three of four MSOs on this page it would still select this one, okay? So we've got that one taken care of and we need to get to the other, so let's go back here and get these buttons again.
I'm just gonna double-click this one, "Shift+Click" the other one, and now I'm gonna copy that to the clipboard with "Command+C". Let's go back to our Object States Panel again, let's go to Fisherman's Wharf which is number three here, and I'm gonna paste these in place with the keyboard shortcut that I set for that as "Command+C", and I'm going to select the MSO as well with a "Shift+Click". So now I've got both buttons and I've got the MSO, and we're gonna add that to the visible state.
Now, I'm not gonna add the actions yet, alright? I wanna just get these into each state first. So let's go to state four, let's do "Command+V" for paste in place, I'll select the MSO again and let's add those in. And now let's go to state three, and I'm gonna paste them but this time out I only want the Go To Previous State button here, so let's just de-select both of these, I'm going to select that and I'm going to select the MSO as well, and let's just get that single one into that state.
And now let's come up to state one, and you can see I left this one behind. And I'm gonna select that, I'll select the MSO as well, and now I'm going to add this one into this state by clicking Add to Visible State. So, now I've got all the buttons in place but none of them are doing anything except for that second state that I already set. So, let's just open up the Buttons and Forms Panel here. From the first state I've got the button selected, I'm in the MSO, I'm going to add the action for Go To Next State, and now that'll stick in the MSO.
So, let's go back to the Object States Panel, go to the second state, and let's just make sure that I did this one already by clicking on the Buttons and Forms Panel, and you can see I already did those earlier. So, let's go on to state three which is named state five because we re-ordered them a little earlier on. And I'm gonna do the same thing, I'm gonna grab this one by double-clicking, opening the Buttons and Forms Panel go to Next State, same thing here, let's get that one done and Go To Previous State.
Let's go to the Object States Panel again, get the MSO selected, and let's get to the next state. We've gotta get this one done here by double-clicking on the Go To Next State button, we'll open our Buttons and Forms Panel again, click on Go To Next State for that action, Let's get the other button by double-clicking on it and we can add the Go To Previous State action to that one. Now we've got one left, let's just make sure that we've got that one, let's go to the last state here, let's just make sure that we've got an action on this button, and we'll do that by double-clicking to select it and we'll just add the Go To Previous State action.
Alright, I think we've got 'em all, so let's test it out. We've got the MSO selected, I can open the Object States Panel and then from the bottom here we can launch the EPUB in our Activity Preview Panel. Okay, well, so far this looks okay, and I've only got the one button showing, let's see what happens when we roll over it. Sure enough the cursor changes, so let's click on that and see what happens. And we go to the next state. We'll try it from here as well. Let's try the previous state button, let's see how that works.
Yep, that's works good. So let's get to the end and here we are at five. And, again, we've got no Go To Next State action so let's just click on the previous and see how that works. That's it, by adding the buttons to the individual states you can customize the way each state works, but it is a bit tedious. Now, if you wanna make a little bit easier there's a third-party extension that I highly recommend, and we'll be taking a look at that next.
- 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