# Please help with actionscript for a 3 minute countdown timer

**URL:** <https://forum.kirupa.com/t/please-help-with-actionscript-for-a-3-minute-countdown-timer/329757>\
**Category:** flash\
**Created:** [October 11, 2012, 8:29pm UTC](https://forum.kirupa.com/t/please-help-with-actionscript-for-a-3-minute-countdown-timer/329757 "2012-10-11T20:29:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sondraleigh](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@sondraleigh](https://forum.kirupa.com/u/sondraleigh)\
**Post date:** [October 11, 2012, 8:29pm UTC](https://forum.kirupa.com/t/please-help-with-actionscript-for-a-3-minute-countdown-timer/329757/1 "2012-10-11T20:29:16Z")

</div>

Hello - I am attempting to make a three minute countdown timer that ends when it hits zero. I have actionscript that starts counting down, but the minute never goes down, just the seconds and they continue on a loop. :crying: My text box is called countdown\_txt. Can someone please help me figure this out? THANKS!!!

countdown\_txt.text=“03:00”;  
var dispSecs=60;  
var dispMins=3;  
var timerInterval=setInterval(countDown,1000);  
function countDown()  
{  
dispSecs–;  
if(dispSecs==59)  
{  
dispMins–;  
}  
if(dispSecs==0)  
{  
dispSecs=59;  
}  
if(dispMins==0 && dispSecs==0){  
clearInterval(timerInterval);  
}  
countdown\_txt.text=prependZero(dispMins)+":"+prependZero(dispSecs);  
}

function prependZero(num)  
{  
if(num\<10)  
{  
num=“0”+num;  
}  
return(num);  
}
