Forum Discussion
Tracking the order of buttons being pushed
have four variables, they could be type NUMBER and initialised as 0 (zero). For example:
step1
step2
step3
step4
In this example, each button represents a step in making and eating a boiled egg:
Button 1: "add oil to the pan"
Button 2: "heat the pan"
Button 3: "crack egg into pan"
Button 4: "cook egg"
Then, each of those steps, will be assigned a step order. So, if I select "Cook egg", this will assign a value of "4" to the current step, by checking each of the variables step1, step2, step3, step4 by using the following logic:
On click button "cook egg"
Set variable step1 = 4 if step1 is equal to 0 (zero)
Set variable step2 = 4 if step2 is equal to 0 (zero)
Set variable step3 = 4 if step3 is equal to 0 (zero)
Set variable step4 = 4 if step4 is equal to 0 (zero)
Set state "cook egg" disabled
I’m not right now in a position to test this, but if they all default to 0, then it seems as if clicking “cook egg” will set all of them to 4, because SL will execute all of the “cook egg” triggers when “cook egg” is clicked. Since they are now all “4”, none of the later clicks will change any of them..
- SamHill10 months agoSuper Hero
You are right Walt, it would need more logic to determine if any of the variables have yet been set to the current value.