用flash as3.0制作一个10分钟倒计时(精确到毫秒)!求源代码~~
2个回答
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐于2016-05-27
展开全部
package{
import flash.display .MovieClip;
import flash.events .*;
import flash.utils.Timer ;
import flash.text.TextField;
public class Dao extends MovieClip{
var txt:TextField;
var i:Number=1;
var myTimer:Timer;
var zong:Number;
var m:int;
var s:int;
var hs:int;
//var ts:int;
//var tm:int;
//var tms:int;
public function Dao(){
txt=new TextField();
txt.x=150;
txt.y=200;
txt.width=300;
addChild(txt);
myTimer= new Timer(10);
btn1.addEventListener(MouseEvent.CLICK,mc);
btn2.addEventListener(MouseEvent.CLICK,mp);
}
public function mc(Event:MouseEvent) {
myTimer.addEventListener(TimerEvent.TIMER, showText);
myTimer.start();
}
public function showText(event:TimerEvent) :void{
zong=10*60*100-i;
m=int(zong/100/60);
s=int(zong/100%60);
hs=int(zong%100);
//m=int(zong/100/60);
//s=int(zong/100/10);
//hs=int(zong/10/60);
txt.text="倒计开始:"+m+"分"+s+"秒"+hs+"毫秒";
i++;
}
public function mp(Event:MouseEvent) {
myTimer.stop();
}
}
}
import flash.display .MovieClip;
import flash.events .*;
import flash.utils.Timer ;
import flash.text.TextField;
public class Dao extends MovieClip{
var txt:TextField;
var i:Number=1;
var myTimer:Timer;
var zong:Number;
var m:int;
var s:int;
var hs:int;
//var ts:int;
//var tm:int;
//var tms:int;
public function Dao(){
txt=new TextField();
txt.x=150;
txt.y=200;
txt.width=300;
addChild(txt);
myTimer= new Timer(10);
btn1.addEventListener(MouseEvent.CLICK,mc);
btn2.addEventListener(MouseEvent.CLICK,mp);
}
public function mc(Event:MouseEvent) {
myTimer.addEventListener(TimerEvent.TIMER, showText);
myTimer.start();
}
public function showText(event:TimerEvent) :void{
zong=10*60*100-i;
m=int(zong/100/60);
s=int(zong/100%60);
hs=int(zong%100);
//m=int(zong/100/60);
//s=int(zong/100/10);
//hs=int(zong/10/60);
txt.text="倒计开始:"+m+"分"+s+"秒"+hs+"毫秒";
i++;
}
public function mp(Event:MouseEvent) {
myTimer.stop();
}
}
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询