计时效果(正,倒)计时效果(正,倒)(
Flash)
计时效果(正,倒)
点击浏览该文件
本来想写个教程的,有些懒惰,也比较忙,所以就不写了!把源码提供给大家,看不明白的话就跟帖子问下:
主要代码:
onClipEvent(load){
OK1=false;
OK2=false;
}
onClipEvent(enterFrame){
if(OK1){//倒数计时;
a=getTimer()-_root.time1;
totaltime=_root.min*60*1000+_root.sec*1000;
nowtime=totaltime-a;
this.txt_m=int(int(nowtime/1000)/60);
this.txt_s=((int(nowtime/1000))-(int(int(nowtime/1000)/60))*60);
this.txt_mm=int((nowtime-this.txt_m*60*1000-this.txt_s*1000)/10);
if((this.txt_m==0)&&(this.txt_s==0)&&(this.txt_mm==0)){
_root.warning="time out!"
this.OK1=false;
}
}
if(OK2){//正数计时;
b=getTimer()-_root.time1;
this.txt_m=int(int(b/1000)/60);
this.txt_s=((int(b/1000))-(int(int(b/1000)/60))*60);
this.txt_mm=int((b-this.txt_m*60*1000-this.txt_s*1000)/10);
if((this.txt_m==_root.min)&&(this.txt_s==_root.sec)){
_root.warning="time out!"
this.OK2=false;
}
}
}
用按钮控制ok1 ,ok2的值 实现正数与倒数计时;
FLA:
点击浏览该文件
2006-01-08 15:05:52.0