I want my animation to advance 120 pixels each time. Instead, my animation goes back to the bottom, rather than advance from it's new position. It assumes a new position, but always go back to the bottom first. How do I get my animation to advance from it's current position each time?
GOAL
I want my animation to advance 120 pixels from current new position, and repeat after ten.
PROBLEM
Animation resets to bottom each time, before advancing. I don't if it's a Tweener problem, how I set up my loop, or something unrelated. If you can give me an example of how to modify this code, I would be appreciated.
NumbersView.as 'the code works, but in a messed up way as described'
package
{
import flash.display.DisplayObject;
import flash.display.MovieClip;
import flash.utils.Dictionary;
import flash.events.Event;
import caurina.transitions.Tweener;
public class NumbersView extends MovieClip
{
private var _listItems:Array;
private var previousNums:Array;
private const numHeight:int = 120;
public function NumbersView()
{
_listItems = new Array();
previousNums = new Array();
//Tweener.init();
var item:NumberImage;
for (var i:Number = 0; i < 9; i++) {
item = new NumberImage();
addChild(item);
item.x = i * item.width;
_listItems.push(item);
}
}
public function setTime($number:String):void {
var nums:Array = $number.split("");
//trace("$number = " + $number);
for (var i:Number = 0; i < nums.length; i++) {
if (nums[i] == previousNums[i]) continue;
Tweener.removeTweens(_listItems[i]);
//newY:int = -numHeight;
var newY:int = int(nums[i]) * -numHeight;
trace("newY = " + newY);
trace("currY = " + _listItems[i].y);
if (_listItems[i].y < 0) _listItems[i].y = numHeight;
Tweener.addTween(_listItems[i], { y:newY, time:3 } );
}
previousNums = nums;
}
}
}