Issue with Countdown Timer

JustMe74JustMe74 Member, PRO Posts: 542
edited April 2012 in Working with GS (Mac)
I implemented the countdown timer from the example on Tshirtbooth's site (gshelper.com) but I'm having an issue. When the "Pause" function is run, the timer still counts down.

I tried creating a variable "IsPaused" that can be true/false. When Pause is run, I set it to true. I added a Rule to only run the timer if the function is set to False... unfortunately this had the effect of just restarting the timer from the top value when I unpause.

I'm sure there is a simple solution, but I can't seem to find it.

Best Answer

  • tenrdrmertenrdrmer Posts: 9,934
    Accepted Answer
    I would have my timer attribute setup and then a rule

    When IsPaused is false
    -every 0.1 seconds change attribute timer to (time - 0.1)

    Also make sure you are not checking run to completion as it may not stop even once the rule becomes invalid.

Answers

  • JustMe74JustMe74 Member, PRO Posts: 542
    Thanks -- that worked. I had to re-write my timer function but I have it working now.
Sign In or Register to comment.