Hello, im new to this board! My name is Jamie, and I have recently discovered the Greensock tools.
I understand TweenMax for basic animation and am just getting to grips with TimelineMax for advanced animation. I have a question regarding arrays and the staggered start time for 2 arrays I have setup. *im assuming I need 2 arrays in this case as there are 2 animation sequences, right to left and left to right. If you view the first animation attached you will see the animation I am trying to accomplish with an array (why not!)
The code I have used is from Carl Schooff at Snorkle.tv
http://www.snorkl.tv/2010/08/a-quick-lo ... ax-tweens/
Towards the end he says you can tween the array, I tried it and it works but only on one side naturally. Referring to the first file attached I would like the animation to read right to left first, then left to right and so on indefinately.
here is what I tried;
import com.greensock.*;
import com.greensock.easing.*;
var rightleft_arr:Array = new Array(testimonialone_mc, testimonialthree_mc, testimonialfive_mc);
var leftright_arr:Array = new Array(testimonialtwo_mc, testimonialfour_mc, testimonialsix_mc);
var timeline:TimelineMax = new TimelineMax({repeat:-1});
for(var key:String in rightleft_arr){
var mc:MovieClip = MovieClip(rightleft_arr[key]);
timeline.append(TweenMax.from(mc, .5, {x:903, blurFilter:{blurX:20}}));
timeline.append(TweenMax.to(mc, 5, {x:13, ease:Linear.easeNone}));
timeline.append(TweenMax.to(mc, .5, {x:-357, blurFilter:{blurX:20}}));
}
/*for(var key:String in leftright_arr){
var mc:MovieClip = MovieClip(leftright_arr[key]);
timeline.append(TweenMax.from(mc, .5, {x:-279, blurFilter:{blurX:20}}));
timeline.append(TweenMax.to(mc, 5, {x:613, ease:Linear.easeNone}));
timeline.append(TweenMax.to(mc, .5, {x:983, blurFilter:{blurX:20}}));
}*/
You can see I commented out the second array, this is where I get stuck. I need a way of telling TimelineMax to run the first array, and then the second, back to the first and so on. If I can get this right then this opens up huge possibilities for future tweening with this engine.
Here is the code from the first file
import com.greensock.*;
import com.greensock.easing.*;
var timeline:TimelineMax = new TimelineMax();
timeline.append(TweenMax.from(testimonialone_mc, .5, {x:903, blurFilter:{blurX:20}}));
timeline.append(TweenMax.to(testimonialone_mc, 5, {x:13, ease:Linear.easeNone}));
timeline.append(TweenMax.to(testimonialone_mc, .5, {x:-357, blurFilter:{blurX:20}}));
timeline.append(TweenMax.from(testimonialtwo_mc, .5, {x:-279, blurFilter:{blurX:20}}));
timeline.append(TweenMax.to(testimonialtwo_mc, 5, {x:613, ease:Linear.easeNone}));
timeline.append(TweenMax.to(testimonialtwo_mc, .5, {x:983, blurFilter:{blurX:20}}));
timeline.append(TweenMax.from(testimonialthree_mc, .5, {x:903, blurFilter:{blurX:20}}));
timeline.append(TweenMax.to(testimonialthree_mc, 5, {x:13, ease:Linear.easeNone}));
timeline.append(TweenMax.to(testimonialthree_mc, .5, {x:-357, blurFilter:{blurX:20}}));
timeline.append(TweenMax.from(testimonialfour_mc, .5, {x:-279, blurFilter:{blurX:20}}));
timeline.append(TweenMax.to(testimonialfour_mc, 5, {x:613, ease:Linear.easeNone}));
timeline.append(TweenMax.to(testimonialfour_mc, .5, {x:983, blurFilter:{blurX:20}}));
timeline.append(TweenMax.from(testimonialfive_mc, .5, {x:903, blurFilter:{blurX:20}}));
timeline.append(TweenMax.to(testimonialfive_mc, 5, {x:13, ease:Linear.easeNone}));
timeline.append(TweenMax.to(testimonialfive_mc, .5, {x:-357, blurFilter:{blurX:20}}));
timeline.append(TweenMax.from(testimonialsix_mc, .5, {x:-279, blurFilter:{blurX:20}}));
timeline.append(TweenMax.to(testimonialsix_mc, 5, {x:613, ease:Linear.easeNone}));
timeline.append(TweenMax.to(testimonialsix_mc, .5, {x:983, blurFilter:{blurX:20}}));
It works yes, but it would be nice to cut down on the amount of code and control the parameters of perhaps an entire array rather than each line individually which is the purpose of my post.
Can anyone help me?
Thanks
Jamie