Hi, I'm wondering something about the function-based values feature in TweenMax.
If I put in an anonymous function for a value, say the x parameter in a Tween, it works.
But if I put in a named function instead (that's defined elsewhere in the page), it breaks. It seems like it should work because the function is returning the same value.
I'm just looking for an easy way to randomize initial values in a "from" tween. I don't want to keep entering in the randomization function for every parameter passed to TweenMax...a better workflow is of course to define one randomization function and then call it for each parameter where it's needed, like:
TweenMax.staggerFrom(_titleChars, .5, { opacity:0,
x:randomBetween(-500,500),
y:randomBetween(-500, 500),
ease:Power3.easeOut,
delay:.7}, 0.1);
function randomBetween(min,max){
return Math.floor(Math.random()*(max-min+1)+min);
}
Is there a way to do this that I'm not seeing? I have that feeling like I'm just missing a tiny bit of info here.
Any help is appreciated!
thanks,
matt