[Tweener] Tighten the Loop Part II

Matt Tedeschi matt at qwlproductions.com
Tue Oct 28 14:58:34 PDT 2008


Going a bit crazy here trying to figure out how to make a loop where movie
clips enter from stage left -- sit on stage for some time -- and then exit
stage right (so the clips need to be reset to the negative stage left
x)... I have the loop working, except for that the gap between the last
clip and the first clip is too wide.
If you care to take a look you can see it working here:
http://www.qwlproductions.com/tweener/test.swf

I just need the transitions to be the same... from the red box to the
black box though, there is a delay.

I've just not been able to figure out what's wrong -- changing the delay
or time on any of the settings hasn't proved fruitful.  The only thing
that did seem to work was removing the -- time: .5 -- setting on the
second 'box3' tween, but then that takes away the smooth transition.

Can you help me see what's wrong?? Thanks in advance.

import caurina.transitions.*;

function slideBoxes():void {

	var boxArray:Array = new Array(box1, box2, box3);

	for (var i:uint = 0; i < boxArray.length; i++) {
		var boxLocation = boxArray[i];
		boxLocation.x = -400;
		boxLocation.y = 0;
		boxLocation.alpha = 1;
	}

	Tweener.addTween(box1, { x: 0, time: .5, delay: 0, alpha: 1, transition:
"easeIn" } );
	Tweener.addTween(box1, { x: 400, time: .5, delay: 5, alpha: 0,
transition: "easeOut" } );

	Tweener.addTween(box2, { x: 0, time: .5, delay: 5, alpha: 1, transition:
"easeIn" } );
	Tweener.addTween(box2, { x: 400, time: .5, delay: 10, alpha: 0,
transition: "easeOut" } );

	Tweener.addTween(box3, { x: 0, time: .5, delay: 10, alpha: 1, transition:
"easeIn" } );
	Tweener.addTween(box3, { x: 400, time: .5, delay: 15, alpha: 0,
transition: "easeOut", onComplete:slideBoxes } );

}

slideBoxes();



More information about the Tweener mailing list