0
嗨,大家好我一直在嘗試這個好幾個小時,但是我仍然無法循環這個函數,至少我想重複5次,但它只循環一次,我試過了使用循環,同時,做一段時間,但它仍然不會循環在動作腳本中循環一個函數
var myTimer:Timer = new Timer(1000); // 1 second
myTimer.addEventListener(TimerEvent.TIMER, runMany);
myTimer.start();
function runMany(event:TimerEvent):void {
myTimer.stop();
myTimer.start();
trace("runMany() called @ " + getTimer() + " ms");
if(getTimer() > 3000)
{
//random call of captopn and costumer in 3 seconds
myTimer.stop();
capsChoice = randomRange(1, 3);//random caption
costumChoice = randomRange(1, 3);//randomcostum
//condition in caption
more codes in here………...
}
}