我想在第三个计时器之后创建一个循环,直到程序结束,然后在第三个计时器处返回,但程序在最后一个计时器之后停止。我也尝试了“for”功能,但没有成功。
这是我的代码:
var i:Number = 0;
disco.visible = false;
palouki.visible = false;
konto.visible = false;
runner.visible = false;
mtext.visible = false;
container.visible = false;
atfa.visible = false;
var playert1: Timer = new Timer(1000, 1);
var playert2: Timer = new Timer(1500, 1);
var playert3: Timer = new Timer(2000, 1);
var playert4: Timer = new Timer(2500, 1);
var playert5: Timer = new Timer(3000, 1);
var playert6: Timer = new Timer(3500, 1);
var playert7: Timer = new Timer(5000, 1);
playert1.addEventListener(TimerEvent.TIMER, timert1F);
playert2.addEventListener(TimerEvent.TIMER, timert2F);
playert3.addEventListener(TimerEvent.TIMER, timert3F);
playert4.addEventListener(TimerEvent.TIMER, timert4F);
playert5.addEventListener(TimerEvent.TIMER, timert5F);
playert6.addEventListener(TimerEvent.TIMER, timert6F);
playert7.addEventListener(TimerEvent.TIMER, timert7F);
playert1.start();
playert2.start();
playert3.start();
playert4.start();
playert5.start();
playert6.start();
playert7.start();
function timert1F(e:TimerEvent):void{
mtext.visible = true;
TweenLite.from(mtext, 0.5, {alpha:0});
}
function timert2F(e:TimerEvent):void{
container.visible = true;
TweenLite.from(container, 0.5, {alpha:0});
}
while (i<100){
function timert3F(e:TimerEvent):void{
disco.visible = true;
TweenLite.from(disco, 0.5, {alpha:0});
}
function timert4F(e:TimerEvent):void{
runner.visible = true;
TweenLite.from(runner, 0.5, {alpha:0});
}
function timert5F(e:TimerEvent):void{
palouki.visible = true;
TweenLite.from(palouki, 0.5, {alpha:0});
}
function timert6F(e:TimerEvent):void{
konto.visible = true;
TweenLite.from(konto, 0.5, {alpha:0});
}
function timert7F(e:TimerEvent):void{
atfa.visible = true;
TweenLite.from(atfa, 0.5, {alpha:0});
}
trace(i);
i++;
}
stop();