# As2 Problem resetting timer interval

**URL:** <https://forum.kirupa.com/t/as2-problem-resetting-timer-interval/331447>\
**Category:** flash\
**Created:** [August 2, 2013, 4:02pm UTC](https://forum.kirupa.com/t/as2-problem-resetting-timer-interval/331447 "2013-08-02T16:02:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxxx923](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@maxxx923](https://forum.kirupa.com/u/maxxx923)\
**Post date:** [August 2, 2013, 4:02pm UTC](https://forum.kirupa.com/t/as2-problem-resetting-timer-interval/331447/1 "2013-08-02T16:02:21Z")

</div>

I have a timer that i made using object oriented coding. the timer works perfectly the first time when the game starts, but every time you win or lose and press space to restart at the first frame the timer interval doubles.

this is my timer code:

var cur\_timer = 0;  
function timer()  
{

```
if (_root.timeron)
{
    cur_timer += 1;
}
timer = cur_timer;

```

}

time\_interval = setInterval(timer, 1000);
