# Timer

**URL:** <https://forum.kirupa.com/t/timer/306358>\
**Category:** Uncategorized\
**Created:** [March 13, 2010, 10:27pm UTC](https://forum.kirupa.com/t/timer/306358 "2010-03-13T22:27:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![glw1988](https://avatars.discourse-cdn.com/v4/letter/g/90ced4/32.png) [@glw1988](https://forum.kirupa.com/u/glw1988)\
**Post date:** [March 13, 2010, 10:27pm UTC](https://forum.kirupa.com/t/timer/306358/1 "2010-03-13T22:27:09Z")

</div>

i am trying to create a timer that when it reaches to the number 10 it changes the text in a dynamic text box, i have got the timer counting but when it gets to 10 it doesnt do anything

here is my code:

```auto

stop()
cooltimer.text = "0";
var myTimer:Timer=new Timer(1000,0);
myTimer.addEventListener(TimerEvent.TIMER, stopTime);
function stopTime(event:TimerEvent):void {cooltimer.text=String(myTimer.currentCount);
}
cooldown_btn.addEventListener(MouseEvent.CLICK, startTime);
function startTime(event:MouseEvent):void 
{myTimer.start()
if cooltimer.text==10 {
 reply_txt.text = "Congrats"
}
}

```
