如何在flex 4中设置超时?

Flex 4中的setTimeout函数是什么?

我尝试过像setTimeout()或setInterval这样的旧方法,但没有工作,也没有找到任何网页引用,有人都知道吗?谢谢你们

最佳答案 对setTimeout,setInterval等使用
flash.utils.Timer

//first parameter is delay in milliseconds, 
//second one is number of repetitions required - 
//use zero for infinite repetition

var timer:Timer = new Timer(100, 4);
timer.addEventListener(TimerEvent.TIMER, onTimerTick);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerDone);
function onTimerTick(e:TimerEvent):void
{
   var timer:Timer = Timer(e.target);
   trace(timer.delay * timer.currentCount + " milliseconds passed");
}
function onTimerDone(e:TimerEvent):void
{
   trace("Timer complete");
}
点赞