急求一个150秒和180秒的FLASH倒计时器~~

2024-12-15 06:59:53
推荐回答(2个)
回答1:

150秒的倒计时。

as3代码给你,自己改吧

import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.events.MouseEvent;

var time:int = 150;
var i:int = time;
var tTimer:Timer = new Timer(1000);
a_btn.visible = false;
t_lab.visible=false;
function onTimer(e:TimerEvent):void
{
 
 time_txt.text = i.toString();
 if (i==0)
 {
  tTimer.stop();
  lable.visible = false;
  a_btn.visible = true;
  t_lab.visible=true;
  time_txt.visible=false;
  
 }
 i--;
}
tTimer.addEventListener(TimerEvent.TIMER,onTimer);
tTimer.start();
a_btn.addEventListener(MouseEvent.MOUSE_DOWN,ondown);
function ondown(e:MouseEvent):void
{
 tTimer.start();
 a_btn.visible = false;
 lable.visible = true;
 t_lab.visible=false;
 time_txt.visible=true;
 time_txt.text="";
 i=time;
}

回答2:

你先下载了看一下,不好用继续追问