Forum Discussion
Numeric variable trigger is not affecting state of Next button
- 2 days ago
Thanks for sharing the screenshot.
Without seeing the full slide, the first thing I'd suggest is to add your reference variable for %Items_Castaway% to your slide to see if it's counting correctly.
But the thing that stands out the most is the trigger order and how you're counting the selected items. Storyline's Selected state should work because it automatically toggles between Normal and Selected. Here's what I'd try:I attached a quick .story file you can look at to see if it helps.
ChrisWalkerBH: I agree with PhilMayor. Use an invisible layer to calculate how many buttons are in the Selected state.
I'll add a few notes:
- As DavidAnderson mentioned, Storyline automatically toggles between the Normal and Selected state, so you don't need triggers for that. (Here's more info about built-in states.) As Phil mentioned, just add a trigger to each button to show the invisible layer.
- As David also mentioned, troubleshooting is easier when you show the variable reference in a temporary text box. That lets you see whether the value changes as expected.
- Have the triggers in the invisible layer run in that order when the timeline starts on the layer. (Note: Another option for hiding the layer would be to make the layer's Timeline as short as possible, and have a trigger that hides the layer when the Timeline ends.)
- Be sure to set the Slide Layer Properties to "Reset to initial state."
- Because you want exactly 8 items selected (no more, no less), add an Else statement to the trigger that changes the state of Next to Normal. The Else statement should change Next to Disabled. That will ensure that if the user clicks another button after Next is enabled, Next will be disabled again. Then they'll have to deselect a button before Next is enabled again.
The use of the variable reference and the Else state were immensely helpful in troubleshooting and improving this slide. Thanks to both you and PhilMayor!