Share Posted May 14, 2013 Hi, I'm tweening a timeline to a label but there doesn't seem to be any way of controlling the duration myTimeline.tweenTo("zoom1"); I want something like this, 3 seconds TweenMax.to(myTimeline, 3 ,{tweenTo:"zoom1"}) Is it possible? Link to comment Share on other sites More sharing options...
Share Posted May 14, 2013 Absolutely. Here's the easy answer: myTimeline.tweenTo("zoom1").duration(3); But just so you know, tweenTo() method is just a convenient way to tween the timeline's "time" value, so under the hood it is basically doing something like this: //first pause the timeline so that it doesn't keep trying to update itself - our tween will drag the playhead yourTimeline.pause(); //figure out the destination time (let's assume you passed in a label): var time:Number = yourTimeline.getLabelTime(label); //figures out the duration automatically, assuming you want the timeline to play at normal speed linearly var duration:Number = Math.abs(time - yourTimeline.time()); //now spit back the tween: return TweenLite.to(yourTimeline, duration, {time:time, ease:Linear.easeNone}); So you're welcome to do that kind of thing yourself directly instead: yourTimeline.pause(); TweenLite.to(yourTimeline, 3, {time:yourTimeline.getLabelTime("zoom1"), ease:Linear.easeNone}); 1 Link to comment Share on other sites More sharing options...
Author Share Posted May 14, 2013 Thanks a lot for your reply. I didn't have any luck, using the last one. I get this error: timeline.pause(); TweenMax.to(timeline, 2, {time:timeline.getLabelTime("zoom1"),ease:Quart.easeOut}); Error #1069: Property time not found on com.greensock.TimelineMax and there is no default value. Link to comment Share on other sites More sharing options...
Share Posted May 14, 2013 Oh, are you using the old v11 stuff? Please make sure you update to version 12 if at all possible: http://www.greensock.com/v12/. If you need to use v11, you'd need to reference "currentTime" instead of "time". Link to comment Share on other sites More sharing options...
Author Share Posted May 15, 2013 Hi, this works now. Thanks Strange, I used the link on http://www.greensock.com/tweenlite/ is that not the latest version? Thanks again Link to comment Share on other sites More sharing options...
Share Posted May 15, 2013 Hi, sorry for the confusion. You can get the latest versions of v11 or v12 from that page. Take a look at the text under the word "important" up top. Hopefully that clears things up. Chances are you went right for the AS3 button without reading... totally understandable. Link to comment Share on other sites More sharing options...
Author Share Posted May 15, 2013 Ah I should pay more attention. Thanks for your help Link to comment Share on other sites More sharing options...
Share Posted December 18, 2013 Apologies for bringing up an old topic, but just want to point out to anyone else who finds this thread that this syntax: myTimeline.tweenTo("zoom1").duration(3); Doesn't work - the tween continues at the previous duration, even though the duration property reports back the changed value. You have to manually do it as was posted above: timeline.pause(); TweenMax.to(timeline, 2, {time:timeline.getLabelTime("zoom1"),ease:Quart.easeOut}); Link to comment Share on other sites More sharing options...
Share Posted December 19, 2013 Ah yes, thanks for pointing that out - it'll be fixed in the next update. If you'd like an early preview, just let me know. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now