# Resetting a countdown timer to a new value

**URL:** <https://forum.kirupa.com/t/resetting-a-countdown-timer-to-a-new-value/303038>\
**Category:** flash\
**Created:** [January 12, 2010, 8:38pm UTC](https://forum.kirupa.com/t/resetting-a-countdown-timer-to-a-new-value/303038 "2010-01-12T20:38:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mickster](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@Mickster](https://forum.kirupa.com/u/Mickster)\
**Post date:** [January 12, 2010, 8:38pm UTC](https://forum.kirupa.com/t/resetting-a-countdown-timer-to-a-new-value/303038/1 "2010-01-12T20:38:11Z")

</div>

I made a ten minute timer that starts at 600 and counts down to zero. It displays the current count in a textfield called “textfield\_time”. Here’s what it looks like:

```auto
 
var timer:Timer = new Timer(1000, 600);
 
timer.addEventListener(TimerEvent.TIMER, countdown);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, termin);
timer.start();
textfield_time.text ="600";
 
function countdown(event:TimerEvent) {
if(timer.currentCount<21){
textfield_time.text ="" +String(600 - timer.currentCount);
}
else{
textfield_time.text ="" +String(600 - timer.currentCount);
}
}
 
function termin(event:TimerEvent) {
textfield_time.text="0";
}

```

So far so good. Now, I have a time pickup that floats across the screen now and then. When your avatar makes contact with it, you get extra time - say 15 seconds. I already have working code that detects the collision of the avatar and the pickup, but I can’t figure out how to add functionality to reset the timer to give an additional 15 seconds. I tried:

```auto
timer+=15;

```

which doesn’t work. But you already knew that (hey, I’m new at this!). Any ideas? Maybe some way to get the currentCount value, increment it by 15 seconds, then update the timer value with it?
