Hi, Iām trying to manipulate the timer by using buttons which can add or subtract seconds. I can successfully update the myText1 with the updated value but I once the timer starts, the timer gets back to its original value. Someone please help
var secs:int = 120;myText1.text = timeFormat(secs);
up1.addEventListener(MouseEvent.CLICK, up01);
down1.addEventListener(MouseEvent.CLICK, down01);
timer.addEventListener(TimerEvent.TIMER, countdown);
function down01(event:MouseEvent):void
{
if(secs>=30){
secs = secs - 30;
trace(secs);
myText1.text = timeFormat(secs);
}
}
function up01(event:MouseEvent):void
{
if(secs<360){
secs = secs + 30;
trace(secs);
myText1.text = timeFormat(secs);
}
}
function countdown(event:TimerEvent) {
var totalSecondsLeft:Number = (timer.repeatCount) - (timer.currentCount);
myText1.text = timeFormat(totalSecondsLeft);
}