我有一个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