古詩詞大全網 - 四字成語 - flash as3 怎麽做延時

flash as3 怎麽做延時

給妳個思路:

加個定時器,間隔時間1秒,它的偵聽器中判斷計時器開始後的時間間隔,用switch語句實現妳的目的。

var?timer:Timer=new?Timer(1000);

timer.addEventListener(TimerEvent.TIMER,handleTime);

timer.start();

function?handleTime(e:TimerEvent){

var?interval:int=timer.currentCount;

switch(interval){

case?3:

trace("-------3---------");

break;

case?8:

trace("-------5---------");

break;

case?18:

trace("-------10---------");

break;

}

} 異想天開,這是AS3,不是java,AS3能直接那樣,就不需要大家費力幫妳想辦法了。