Start counting down!
How can I start a countdown from a single button? I am trying to do, however, without success.
I would like the time to run alone after pressing a particular button and pause when it reaches zero. I did only the part of the dynamic text and the discount of numbers, however, everything manual.
can anybody help me?
//var
var score:uint
score = 7;
counting.text = "" + score.toString();
// EventList
up.addEventListener(MouseEvent.CLICK, up1);
// Actions
function up1(Event:MouseEvent): void {
score -= 1;
counting.text = "" + score.toString();
if (score <= 0) {
score = 0;
}
move.gotoAndStop(2);
}
The stopwatch starts in seven seconds, I would like after pressing the "up" button to start counting down to zero and then pause the time.
can anybody help me? Please?
