hey guys.
continuing on from an .onMotionFinshed() question I had asked earlier, I tried using that for a new idea. it is three blocks coming one from the top of the screen one after the other. i’m trying to get them to flow quickly and not have them start motioning the second the one before it completes.
The problem: the blocks should come down in sequence (1, 2, 3). Instead, they go 1, 3. Or, they go 1, 2. Or, they just go 1.
Have a look at the .SWF: here
The code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
top = mx.transitions.easing.Strong.easeOut;
var begin = -100;
var end = 20;
var time = 1.0;
topFinal = new mx.transitions.Tween(blue01_mc, "_y", top, begin, end, time, true);
topFinal.onMotionChanged = function():Void
{
topFinal.broadcastMessage("onPercentageComplete", topFinal.time / topFinal.duration);
}
topFinal.onPercentageComplete = function(progress:Number):Void
{
var percent:Number = Math.round(progress * 100);
if(percent == 20)
{
trace(percent);
var middle = new mx.transitions.Tween(blue02_mc, "_y", top, begin, 107, 1.0, true);
}
else if(percent == 80)
{
trace(percent);
var bottom = new mx.transitions.Tween(blue03_mc, "_y", top, begin, 167, 1.0, true);
}
}
thanks, guys.
EDIT: I think it has something to do with the time for when each tween starts.