Long story short. I have a dynamic panel which has one state that includes a countdown timer. It starts at 10 and counts down to 0 in 1000ms increments.
As it counts down, it also decreases the variable associated with it by one, which is where the text gets its value from as well.
(The timer is like this:
Starts at 10
Wait 1000ms…
Decrease variable by 1
Wait 1000ms…
Decrease variable by 1
Wait 1000ms…
Decrease variable by 1
Wait 1000ms…
Decrease variable by 1
etc…)
So the text counts down to 0 as the variable does. Easy so far.
What I want to do is have a button that stops the countdown. What I have now is a button that resets the variable back to 10, but then keeps counting down until the original timer event stops.
So if it gets down to 4, then I click on the button to reset the variable, it goes to 10, but keeps counting down to 7 because that’s what’s left from the original event.
What I want it to do is to set the variable to 10 AND stop the countdown. I’m sure this is way easier than I’m making it out to be.