

Good day!
In my project I have a layered character that I have made into a multi-state object. I wish for the continue button to show only when the last state is shown. I have only been able to be successful at making the whole multi-state object the trigger, not a specific state itself. This must be possible. Any suggestions?
Good day!
In my project I have a layered character that I have made into a multi-state object. I wish for the continue button to show only when the last state is shown. I have only been able to be successful at making the whole multi-state object the trigger, not a specific state itself. This must be possible. Any suggestions?
You must be logged in to post a comment.

- Most Recent
- Most Relevant
For the sake of variety… or for any other readers who may be curious… here is a pretty simple JavaScript example.
First a few assumptions…
- You are using a button that reveals the next state of your character
- Your character has the name myCharacter
- Your continue button has the name contBtn
- The continue button is hidden at publish
- The last state of your character has the name lastState
The on Success action for the button would be Execute Javascript
The following code placed on the button would advance the character state and check the state of myCharacter to reveal the continue button when the state named lastState is displayed.
cp.goToNextState(“myCharacter”);
if (cp.getCurrentStateNameForSlideItem(“myCharacter”)==”lastState”) {
cp.show(“contBtn”);
}
Of course, you can change the names to be whatever you want but you would simply need to change the names in the code to match.