在timer的时候突然改变影片简介,先前的不暂停

时间:2021-04-09 05:36:01
import flash.display.MovieClip;
import flash.utils.Timer;
import flash.events.TimerEvent;
var hinderArr:Array=[];
for (var i:uint =1; i<=3; i++) {
var ClassReference:Class = getDefinitionByName("Hinder"+i) as Class;
var hinder:MovieClip=new ClassReference();
hinderArr.push(hinder);
}
var n:Number=10;
var timer:Timer=new Timer(25);
timer.addEventListener(TimerEvent.TIMER,timerFun);
timer.start();
function timerFun(e:TimerEvent) {
this.addChild(hinderArr[0]);
hinderArr[0].x=(n+=2);
hinderArr[0].y=300;
if (timer.currentCount==100) {
trace(hinderArr[0]);
this.removeChild(hinderArr[0]);
hinderArr[0]=hinderArr[1];
trace(hinderArr[0]);
}
}