I have this code for my timer
dt_timer.text = "02:00";
var dispSecs = 60;
var dispMins = 2;
var timerInterval = setInterval(countDown, 1000);
function countDown()
{
dispSecs--;
if(dispSecs==59)
{
dispMins--;
}
if(dispSecs==0 && dispMins > 0)
{
dispSecs = 60;
}
if(dispSecs==0)
{
gotoAndPlay(200);
clearInterval(timerInterval);
}
if(dispSecs == 60)
{
dt_timer.text = prependZero(dispMins) + ":" + prependZero(0);
}
else
{
dt_timer.text = prependZero(dispMins) + ":" +prependZero(dispSecs);
}
}
function prependZero(num)
{
if (num < 10)
{
num = "0" + num;
}
return (num);
}
I have buttons that when clicked it will subtract 10 seconds from the timer. I was thingking of using this code in my button
dispSecs - 10;
is that right? Can anyone help me. please?
or