Flash如何清除setinterval 5
场景有1个MC,MC中有2分钟的倒计时,请问如何在场景中清除MC中的setinterval这是计时器的代码txt.text=aa;vari=120;functionaoy...
场景有1个MC,MC中有2分钟的倒计时,请问如何在场景中清除MC中的setinterval
这是计时器的代码
txt.text=aa;
var i = 120;
function aoyuntimelist() {
if (i>0) {
i--;
var min = Math.floor(i/60);
var miao = (i-Math.floor(i/60)*60);
if (min<10) {
min = "0"+min;
}
if (miao<10) {
miao = "0"+miao;
}
aa = String(min)+":"+String(miao);
} else {
//aa="时间到!!!"
clearInterval(intervalID);
}
}
//setInterval(aoyuntimelist, 1000);
var intervalID:Number = setInterval(aoyuntimelist, 1000); 展开
这是计时器的代码
txt.text=aa;
var i = 120;
function aoyuntimelist() {
if (i>0) {
i--;
var min = Math.floor(i/60);
var miao = (i-Math.floor(i/60)*60);
if (min<10) {
min = "0"+min;
}
if (miao<10) {
miao = "0"+miao;
}
aa = String(min)+":"+String(miao);
} else {
//aa="时间到!!!"
clearInterval(intervalID);
}
}
//setInterval(aoyuntimelist, 1000);
var intervalID:Number = setInterval(aoyuntimelist, 1000); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询