Hello...
I have a timeline max instance/sequence.
In that instance I have a sprite (_over) that pops on the stage using transformAroundPoint. As per the 2 lines of code below, at first I set its initial values in the first tweenmax inserted, after a 2 second delay I tween 'on' the sprite in the second tweenmax inserted, and pop on it comes. This works fine.
_timeline.insert( TweenMax.to(_over, 0, {alpha:0, transformAroundPoint:{point:getNewPoint(), scaleX:0.9, scaleY:0.9, shortRotation:{rotation:20}}}) )
_timeline.insert( TweenMax.to(_over, 1, { delay:2, alpha:1, transformAroundPoint: { point:getNewPoint(), scaleX:1, scaleY:1, shortRotation:{rotation:0}}, ease:Elastic.easeOut } ) );
My problem is that when the stage resizes, the point gets changed, and when you navigate back to that page and the timeline max sequence goes through its motions, (I use timelinemax for the initial tweens on each page) the point is different so the tween seems off balance compared to the original tween. I put a trace statement in my getNewPoint function and I noticed that it doesn't get recalled when I subsequently do additional _timeline.restart().
Now, I've had a look at the DynamicProps plug in, and I think my solution lies there, but I can't work out the syntax to get it working with a new dynamic point. I've tried this...
_timeline.insert( TweenMax.to(_over, 0, {alpha:0, transformAroundPoint:{dynamicProps:{point:getNewPoint}, scaleX:0.9, scaleY:0.9, shortRotation:{rotation:20}}}) )
or/and
_timeline.insert( TweenMax.to(_over, 0, {alpha:0, dynamicProps:{transformAroundPoint:{point:getNewPoint}, scaleX:0.9, scaleY:0.9, shortRotation:{rotation:20}}}) )
But both throw errors, and I'm a little bit unsure of the correct syntax or even if what I'm doing is possible. Any help is greatly appreciated, thanks.
Ken.