在timer的时候突然改变影片简介,先前的不暂停
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]); } }
posted on 2018-04-20 16:09 zqiang0803 阅读(159) 评论(0) 编辑 收藏 举报