I am trying to animate in some clips that are part of 3 seperate UI components. So I loop through the clips and try to place them and I am getting strange results. I eventually just tried positioning them with a manual number. So I set the xVar for 1 to 35, for 2 to 150, to 3 to 300. Then when I trace the x values after the tween I am getting (153, 151 and 150).
Here is the code.. what is the deal?!
for(var i:uint = 0; i < 4; i++)
{
if(i == 0)
{
endX = 35;
}else if(i == 1)
{
endX = 150;
}else if(i == 3)
{
endX = 300;
}
Tweener.addTween(deviceHolderUI, {alpha: 1, x: endX, time: 2, transition: "easeInOutExpo", onComplete: function() { trace("D: " + deviceHolderUI.x)}, delay: i/8});
}
so I get this trace onComplete:
D: 153.5 D: 151.3 D: 150
why wouldn't it be:
D: 35 D: 150 D: 300