ActionScript3.0/기초
TimerEvent()
Zeronine
2010. 3. 19. 09:48
var _value:Number = 0;
var _autoTimer:Timer = new Timer(딜레이 시간, 반복횟수)
autoTimer.addEventListener(TimerEvent.TIMER, autoFunc)
autoTimer.start();
function autoFunc (e:TimerEvent):void{
_value++;
trace(_value); // 1, 2, 3, 4,....................
}
Timer(1000, 5); // 밀리초로 계산된다.(1000 = 1초, 2000 = 2초, 500 = 0.5초)
// 반복횟수 : 5 -> 몇번 반복할것인가를 정한다. (5 = 5번 반복, 10 = 10번 반복)
var _autoTimer:Timer = new Timer(딜레이 시간, 반복횟수)
autoTimer.addEventListener(TimerEvent.TIMER, autoFunc)
autoTimer.start();
function autoFunc (e:TimerEvent):void{
_value++;
trace(_value); // 1, 2, 3, 4,....................
}
Timer(1000, 5); // 밀리초로 계산된다.(1000 = 1초, 2000 = 2초, 500 = 0.5초)
// 반복횟수 : 5 -> 몇번 반복할것인가를 정한다. (5 = 5번 반복, 10 = 10번 반복)