嘿,所以我正在尝试将补间应用于数组中的每个项目(这只是一个实验......我正在尝试了解有关补间的更多信息)。这是我的代码:
import flash.events.Event
import fl.transitions.TweenEvent
import flash.events.MouseEvent;
import flash.utils.Dictionary;
import flash.display.MovieClip;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.motion.Color;
var bubbles:Array = [];
var numBubbles:int=55;
for (var i:Number=0; i<=numBubbles-1;i++){
bubbles.push(new bubble());
stage.addChild(bubbles[i]);
startMotion(bubbles[i]);
}
function startMotion( TheBubble:bubble ){
var tweenY:Tween = new Tween(TheBubble, "y", Regular.easeIn, TheBubble.y, -5, 3, true);
}
我的情况是,大多数时候,补间开始播放,但随后所有补间都停止播放,除了其中一个气泡。
有时它们会完成并且当 numBubbles 设置为 5 到 10 之类的低数字时更有可能完成。这可能是一个补间限制问题吗?我不认为这是可能的。
持续存在的气泡不是阵列中的第一个气泡,也不是最后一个。我仍在尝试缩小它的范围,但我已经通过为第一个和最后一个着色来计算出那么多。编辑:它似乎(有点)随机。有时有色人会成功——大多数时候它是其他人之一。
哦,这是泡泡课程:
package{
import flash.display.MovieClip;
import flash.events.Event;
import fl.transitions.Tween;
import fl.transitions.easing.*;
public class bubble extends MovieClip{
var bubbleSize:int;
public function bubble(){
this.bubbleSize=Math.ceil(Math.random()*15)+15;
this.width=bubbleSize;
this.height=bubbleSize;
this.x = Math.random()*(550-bubbleSize);
this.y = 400+Math.random()*400;
}
}
}
我将不胜感激任何帮助或见解!