Economy-x-Talk - Sample Scripts
Countdown Timer 2
Here is a different version that displays the remaining time in minutes and seconds (from 60:00 down to 00:00).
This script has been slightly adjusted to allow for interrupting the countdown.
-- MacBrett
on startCountDown
global gCountingDown,gStartSeconds, gRemainingSeconds
put TRUE into gCountingDown
put "60:00" into cd fld "countdown"
put 3600 into gRemainingSeconds
put the seconds into gStartSeconds
end startCountDown
on idle
global gCountingDown, gStartSeconds, gRemainingSeconds
if gCountingDown is TRUE then
put 3600 - (the seconds - gStartSeconds) into newRemainingSeconds
if newRemainingSeconds < gRemainingSeconds then
put the selectedChunk into savedSelection -- optional
put secondsToMinAndSec(newRemainingSeconds) into cd fld "countdown"
select savedSelection -- optional
put newRemainingSeconds into gRemainingSeconds
if remainingSeconds <= 0 then put FALSE into gCountingDown
end if
end if
pass idle
end idle
function secondsToMinAndSec x
set numberFormat to "00"
put x MOD 60 into theSecs
put x DIV 60 into theMins
set numberFormat to normal
return theMins & ":" & theSecs
end secondsToMinAndSec
on stopCountDown
global gCountingDown
put false into gCountingDown
end stopCountDown
Keep this extensive resource of tutorials and samples on-line! Support RunRev.info!
| Yes, this script is useful. I make a donation and choose freely how much I want to donate on-line (PayPal). Click here if you want to make a donation in dollars. | This script has not (completely) solved my problem and I want Economy-x-Talk to take care of it. Let me contact you. |
Copyright©2002-2008 by Mark Schonewille, Nijmegen, the Netherlands. This web site is in no way affiliated with Runtime Revolution Ltd., but we do recommend the Revolution development platform.