import flash.events.MouseEvent;
import flash.events.Event;
import flash.utils.Timer;
import flash.events.TimerEvent;
var timer:Timer = new Timer(1000);
start_btn.buttonMode = true;
stop_btn.buttonMode = true;
start_btn.addEventListener(MouseEvent.CLICK, onStart, false, 0, true);
timer.addEventListener(TimerEvent.TIMER, onTimer, false, 0, true);
//stage.addEventListener(Event.ENTER_FRAME, onEnter, false, 0, true);
function onStart(evt:MouseEvent):void
{
var minutes:Number = Number(min_txt.text);
var seconds:Number = Number(sec_txt.text);
timer.start();
}
function onTimer(evt:TimerEvent):void
{
minutes--;
trace("Timer Triggered!!");
}
那么我该如何做到这一点,以使“分钟-”起作用..因为变量在一个单独的函数中..
(或给我另一种方式)..
谢谢..