Hey Jack,
I'm trying to improve on the current method of applying animating values to Webkit's 3D transforms ( this is my current jQuery implementation http://chrisgannon.w...-and-greensock/ ).
The new method I'm trying is as follows (and allows the tween to be used in TimelineMax etc).
var myObject = {value:100};
TweenMax.to(myObject, 3, {value:400, onUpdate:applyValue, onUpdateParams:[myObject.value]});
function applyValue (val){
console.log(val); //always passes 100
};
I may be missing something here but I would expect the 'val' parameter to be updated onUpdate but it seems to only pass the initial value that was set. i.e. 100.
The following obviously works but it's no longer a generic function available to any element.
var myObject = {value:100};
TweenMax.to(myObject, 3, {value:400, onUpdate:applyValue, onUpdateParams:[myObject.value]});
function applyValue (val){
console.log(myObject.value); //animates from 100 to 400
};
Is there a way to access/pass the animating value?
I should also point out that I am also placing the tweens in a TimelineMax so that may be the issue.
Cheers,
Chris