Share Posted May 26, 2016 This had to be discussed but i can't find a topic about it. Is there a way to do something like : var obj1 = { myValue:random }; var obj2 = { myValue:random }; ... TweenMax.to([obj1, obj2, ...], d, { myValue:[value1, value2, ...] }); when at the end : obj1.myValue // value1 obj2.myValue // value2 ... ? Link to post Share on other sites
Author Share Posted May 26, 2016 Of course a for loop do the job... var objs = [...]; var values = [...]; for (var i = 0; i < objs.length; i++) TweenMax.to(objs[i], d, { myValue:values[i] }); But we have to declare two arrays first, a single line would be more elegant! Link to post Share on other sites
Share Posted May 26, 2016 Eh? What? Not sure what the question is. But, if you want to cycle thru several values in several elements, the cycle method is your friend. Check out the link but here's the basic usage using your example as a basis: TweenMax.staggerTo([obj1, obj2, ...], d, { cycle:{myValue:[value1, value2, ...]} }); If you omit the stagger amount, it will behave as a simple .to() tween, by the way. 6 Link to post Share on other sites
Author Share Posted May 26, 2016 You may have not understood the question, but you managed to provide the answer ! staggerTo was the keyword, thanks for that 1 Link to post Share on other sites