전공/실무

[as3.0] Timer

하루는노력 2012. 12. 6. 20:05
728x90
반응형

import flash.utils.Timer;
import flash.events.TimerEvent;

var i:int = 1;
var myTimer:Timer;
var subDelay:MovieClip;

for( i; i< 10; i++){
     if(this["subDelay"+i] != undefined){
          subDelay = this["subDelay"+i];
          subTimeDelay(i);
     }
}

function subTimeDelay(delay:uint){
     myTimer = new Timer(delay*1000,1);
     myTimer.start();
     myTimer.addEventListener(TimerEvent.TIMER, subTimerComplete);
     myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, subTimerComplete);
}
function subTimerComplete(e:TimerEvent):void{
     myTimer.reset();
     subDelay.gotoAndPlay(1);
}

언어 버전 : ActionScript 3.0
Player 버전 : Flash Player 9

반응형
LIST

'전공 > 실무' 카테고리의 다른 글

[as3.0] URLRequest  (0) 2012.12.06
[flash] 객체지향 또는 as3.0  (0) 2012.12.06
[as3.0] 백넥과 팝업  (1) 2012.12.06
[as2.0&3.0]volume  (0) 2012.12.06
[as2.0&3.0]controlBar  (0) 2012.12.06