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:
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"
}
}