Im trying to reduce 5 seconds from the timer when the user clicks on the stage.
This is the first time im using the Timer class and im not sure how to do this.
This is the code i have so far,
var theTimer:Timer = new Timer(1000, 60);
theTimer.addEventListener(TimerEvent.TIMER, timerListen);
theTimer.start();
stage.addEventListener (MouseEvent.CLICK, reduceVal);
var reducevalue:Boolean = false;
function timerListen(event:TimerEvent) {
txt.text = String(61 - theTimer.currentCount);
trace (theTimer.currentCount);
}
function reduceVal(event:MouseEvent):void
{
reducevalue = true;
if (reducevalue = true)
{
// REDUCE 5 SECONDS
trace("stage");
txt.text = String(theTimer.currentCount + 5); // Not right
reducevalue = false;
}
}