toggle between two state


do you know if it's possible for a user to toggle between two states of an object by clicking on it? I'd like to have users select 10 items out of 48; once selected, the item state changes so the user can see which items have been selected. I've used a variable to count the total number of selected items, so that if more or less than 10 are selected, the user is warned. But I'd like the user to be able to click on the item a second time to revert to the original state, so they can change their mind on their selection. Is this possible in storyline?


4 Replies
Kate Hoegenauer

Here's what I'm trying to do (but with fewer items).

As you can see, I've created three states for each figure (original, selected and a custom state - result). I've created a variable called count which controls which of the two layers is displayed when the user submits the interaction. And I've created a trigger on each figure which adds 1 to the variable when the figure is in the selected state. When the user selects the figures and hits the submit button, there is a conditional trigger which goes to the results layer when the variable =3. When the variable is not =3, then a layer is displayed which asks the user to ensure that they have selected 3 figures. So the problem is that if the user changes his mind as to which figures he wants to select, the variable doesn't go back down when the figure is toggled back to the original state. I've spent some time in the trigger and variable menus, exploring all the options, but there doesn't seem to be a three from ten (or similar) sort of option at all. Is this even going to be possible?


Garth Yorko

Here is an example where I duplicated your figures

In the Timeline they appear stacked on top of each other.

The higher figure is your black figure with 3 states, Normal, Clicked, and Results.  The clicked state is void of the figure

The lower image is your red figure

When the user selects a black figure there are 2 triggers, one to increment your variable, the other to change its state to Clicked, making it invisble and uncovering the Red figure

If the user clicks the red figure there are two triggers, one to decrement the variable and anothe rto change the state of the Black figure to Normal.

I also added a trigger to display your Feedback layer if your varaible is equal to or greater than 4.  I thought immediate feedback was better than delaying it to when the users clicks the submit button.  But that is a design decision for you.

See attached.