Actionscript 3 如何在as3中进行简单的倒计时

Actionscript 3 如何在as3中进行简单的倒计时,actionscript-3,countdown,Actionscript 3,Countdown,我想在ActionScript3中简单地倒计时。请帮助我如何使它变得简单。 请给我举个例子 你可以朝这个方向倒计时 首先,您必须在actionscript中创建新的文本框,其实例名称必须为Timer 我们正在创建这个动作脚本代码 // Create the two variables. var minute = 0; var second = 0; // Create the timer // Checks the clock function every 1000 milisecon

我想在ActionScript3中简单地倒计时。请帮助我如何使它变得简单。
请给我举个例子

你可以朝这个方向倒计时

首先,您必须在actionscript中创建新的文本框,其实例名称必须为Timer

我们正在创建这个动作脚本代码

    // Create the two variables.
var minute = 0;
var second = 0;

// Create the timer
// Checks the clock function every 1000 milisecond (1 second)
var timer:Timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, clock);
timer.start();

// Function that increments the timer
function clock(evt:TimerEvent):void {
// every time this function is checked increment second by one
second += 1;
// If the second is 59
if(second > 59){
// The minute will be plussed with 1
minute += 1;
//and the zero will be set to 00
second = 00;
}
// Displays the time in the textbox
Timer.text = String("Time is: ["+minute+":"+second+"]");
}

如果你想看看这个游戏的例子,看看!通常在游戏编程中使用的倒计时。你可以在这个网站上看到更多的卡车游戏例子。示例:您必须在2分钟内停车。

您能告诉我们您当前的代码吗?或者你做过什么研究?谢谢我得到了答案很好。