Posts: 602
Threads: 3
Joined: Jun 2009
Reputation:
0
Countdown does not count down.
Countdown is the ID of the timer.
Then you can kill the timer using its ID which is Countdown.
Posts: 360
Threads: 77
Joined: Dec 2009
Reputation:
0
So do i kill that Countdowntimer when it reaches zero?
Posts: 602
Threads: 3
Joined: Jun 2009
Reputation:
0
No, well you can but there is no point.
Countdown = SetTimer("CountDownTimer", 999, false);
Countdown is now the id of the Timer. which is set to run for 999 ms.
So after 999ms the Timer (which has id Countdown) will call the function given
CountDownTimer
So the first variable of SetTimer is the function to call, which is called after the ms given in the second param which in this case is 999.
If you only want the timer to run once, then the third variable should be false, then the timer will stop once it has called CountDownTimer.
So in this case there is no need to kill the timer, it automatically dies.
However if you want to repeatedly call a function you set the third variable to true.
Does that make more sense?