Which condition for trigger?

Dec 10, 2019

I have 20 states of text I want to alternate when I button is clicked. I need to set a condition so that, on click 2, only text state 2 shows, on click 3 only text state three (and not 1 or 2 again). I don't know if I should create my own condition or choose a built-in one. Your help much appreciated.

4 Replies
Anthony Goss

You could track the clicks using a number variable.  Create a new number variable called clicks.  Then, create a trigger to add 1 to the variable when the user clicks the button. Then, use the number to change the state of the text based on the variable: 1=state 1, 2=state 2, etc. You would also need a way to reset the variable back to 0 when the variable changes to the final number so that the user could cycle through again if you wanted to do that. 

Allison LaMotte

Great idea, Anthony! Another way to do it would be to create a trigger for each state that changes the state of the object when it's clicked based on the current state. So for the first trigger it'll say: change state of object1 to click1 when the user clicks if the state of the object is Normal. The second trigger should say change state of object1 to click2 when the user clicks if the state of the object is click1, and so on.

I hope that makes sense! Let me know if you have any other questions. :)

This discussion is closed. You can start a new discussion or contact Articulate Support.