# How to create a timer

**URL:** <https://forum.kirupa.com/t/how-to-create-a-timer/325046>\
**Category:** Uncategorized\
**Created:** [September 23, 2011, 7:52am UTC](https://forum.kirupa.com/t/how-to-create-a-timer/325046 "2011-09-23T07:52:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![baygon](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@baygon](https://forum.kirupa.com/u/baygon)\
**Post date:** [September 23, 2011, 7:52am UTC](https://forum.kirupa.com/t/how-to-create-a-timer/325046/1 "2011-09-23T07:52:38Z")

</div>

we are making a game with a timer that counts from 10 to 0 and it is located inside a vcam which is a movie clip. when the timer ends or timer is now equal to 0 it will go to a frame(which contains some text and buttons) outside the movieclip but the problem that we encountered is that the stage appeared and no texts and buttons… here’s our code for the timer:

```
timerF = 10;

```

countdownF = function(){  
timerF–;  
if(timerF==0){

clearInterval(countdownIntervalF);  
gotoAndStop(“gameOverForest”);  
}

}

countdownIntervalF = setInterval(countdownF,1000);
