我有一個timerEvent,將25個影片剪輯添加到舞臺上,並從x:0,y:0對它們進行動畫處理,這一切都正常!我想要做的是爲每個影片剪輯分配比上一次添加到舞臺上的影片剪輯多25px的y值。我做了一個小測試,試圖在每次定時器執行循環時增加一個數值,但它沒有增加。我應該使用for循環/數組嗎?Flash AS3計時器問題
在此先感謝。 城野
import flash.events.*;
import caurina.transitions.*;
bringItemsOn();
var itemTimer:Timer;
function bringItemsOn():void {
itemTimer=new Timer(300);
itemTimer.addEventListener(TimerEvent.TIMER,itemTimer_tick);
itemTimer.start();
}
function itemTimer_tick(e:TimerEvent):void {
itemTimer.currentCount-1;
var mc:MovieClip = new MovieClip();
mc.graphics.beginFill(Math.random() * 0x000000);
mc.graphics.drawRect(0,0,stage.stageWidth,25);
mc.x=0;
mc.y=0;
addChild(mc);
Tweener.addTween(mc,{y:Math.random()*1000 - 500,
x:0,
time:.9,
transition:"easeOutExpo"});
if (itemTimer.currentCount>=25) {
itemTimer.removeEventListener(TimerEvent.TIMER,itemTimer_tick);
}
}
Tweener.addTween(MC,{Y:mc.y + 50中,x:0,時間:0.9,過渡: 「easeOutExpo」}); 如果我添加/使用了一個for循環,我可以引用每個對象並分配mc [i] + 50,所以只是想知道我是否可以集成 – Jono 2009-03-02 11:38:03