Simple count up timer won't stop.
Hi,
I made a simple count up timer, it is working just fine but I would like to have the %-sign next to the numbers so it would look as a preorder. But as I add "%" sign to the function, the counting never stops (at 100% any more), and continues counting.
What am I missing??
var count:Number = 1;
var myTimer:Timer = new Timer(10);
myTimer.addEventListener(TimerEvent.TIMER, countdown);
myTimer.start();
function countdown(event:TimerEvent):void{
//myText_txt.text = String((count)+myTimer.currentCount);
myText_txt.text = String((count)+myTimer.currentCount)+"%";
if (uint(myText_txt.text) >= 100) {
myTimer.removeEventListener(TimerEvent.TIMER, countdown);
}
}
Thanks!