I found the following code in this forum which displays a count down clock
-- behaviour script attched to a text sprite
on beginSprite me
sprite(me.spriteNum).member.text = "5:00"
startTimer()
end beginSprite
on enterFrame me
tSecElapsed = (the timer)/60
if tSecElapsed < 300 then
tTime = 300 - tSecElapsed
tSec = tTime mod 60
if tSec < 10 then
tSec = "0" & tSec
end if
tMin = tTime/60
sprite(me.spriteNum).member.text = tMin & ":" & tSec
else
sprite(me.spriteNum).member.text = "0:00"
end if
end enterFrame
This obviously works fine but I need one which counts down from 15 seconds (rather than minutes) and have tried changing the code but can't seem to get it to work. Can anyone help?
-- behaviour script attched to a text sprite
on beginSprite me
sprite(me.spriteNum).member.text = "5:00"
startTimer()
end beginSprite
on enterFrame me
tSecElapsed = (the timer)/60
if tSecElapsed < 300 then
tTime = 300 - tSecElapsed
tSec = tTime mod 60
if tSec < 10 then
tSec = "0" & tSec
end if
tMin = tTime/60
sprite(me.spriteNum).member.text = tMin & ":" & tSec
else
sprite(me.spriteNum).member.text = "0:00"
end if
end enterFrame
This obviously works fine but I need one which counts down from 15 seconds (rather than minutes) and have tried changing the code but can't seem to get it to work. Can anyone help?