alflasy Posted May 4, 2010 Share Posted May 4, 2010 Hi I have simple timeline with few images in it and I am scrolling the timeline front and back with scrubber. works great. But I want to add easing on it. Here is the code that moves the timeline while scrubbing timeline.gotoAndStop(ScrollerMC.scrubber.x*timeline.totalDuration/scroll_amount); Is t possible to do it. Please let me know. Thank you Link to comment Share on other sites More sharing options...
GreenSock Posted May 5, 2010 Share Posted May 5, 2010 You can pause() the TimelineLite and tween its currentTime property, sure. Just apply whatever ease you want to that tween. Link to comment Share on other sites More sharing options...
alflasy Posted May 5, 2010 Author Share Posted May 5, 2010 Sorry, didn't get it any example please. Thank you Link to comment Share on other sites More sharing options...
GreenSock Posted May 5, 2010 Share Posted May 5, 2010 Your "timeline" is a TimelineLite or TimelineMax instance, right? If so, you could tween it from wherever it is currently to the 4-second point with a Strong.easeOut ease over the course of 0.5 seconds like this: timeline.pause(); TweenLite.to(timeline, 0.5, {currentTime:4, ease:Strong.easeOut}); Link to comment Share on other sites More sharing options...
alflasy Posted May 10, 2010 Author Share Posted May 10, 2010 Thanks you greensock, I sure you code is right but I can't get it to work. Below is my onPress event code on scruber which start draging. scrubber.onPress = function() { //timeline.stop(); startDrag(this,false,0,this._y,scroll_amount,this._y); timeline.pause(); TweenLite.to(timeline, 0.5, {currentTime:4, ease:Strong.easeOut}); //this.onMouseMove = function(){ //timeline.gotoAndStop(scrubber._x*timeline.totalDuration/scroll_amount) //} }; if I uncomment onMoseMove then it works fine but no easing. Any suggestion please. Thank you Link to comment Share on other sites More sharing options...
GreenSock Posted May 10, 2010 Share Posted May 10, 2010 It sounds like you'd want the tweening in the onMouseMove function. like: scrubber.onPress = function():Void { startDrag(this,false,0,this._y,scroll_amount,this._y); timeline.pause(); scrubber.onMouseMove = onScrubberMove; }; function onScrubberMove():Void { TweenLite.to(timeline, 0.5, {currentTime:scrubber._x*timeline.totalDuration/scroll_amount, ease:Strong.easeOut}); } (I'd recommend avoiding nested functions, by the way - they can cause problems since they're generally deleted when the parent function finishes running). Link to comment Share on other sites More sharing options...
alflasy Posted May 12, 2010 Author Share Posted May 12, 2010 Hmmm, that's not working out. I am just trying to make a smooth easing scrubber for timeline. Link to comment Share on other sites More sharing options...
GreenSock Posted May 12, 2010 Share Posted May 12, 2010 If you want more help, you'll need to post a simple FLA that demonstrates the issue please. 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