Jump to content
Search Community

TimelineMax - Skip between 2 tween

frank6 test
Moderator Tag

Recommended Posts

Hi,

 

I have a timeline that contains those two tweens :

 

tween = TweenMax.from(mc,.7,{x:stage.stageWidth+100+mc.width, autoAlpha:0, motionBlur:true, ease:Cubic.easeOut})
timeline.insert(tween, 0);

tween = TweenMax.to(mc,.7,{x:-mc.width,autoAlpha:0, motionBlur:true, ease:Cubic.easeIn})
timeline.inser(tween, 3.5);

 

and later I do this

 

timeline.totalProgress = scrubber.progress

 

The problem is that sometimes I skip betweens two tweens and my mc isn't visible. I assume that's because its last tween ended with a alpha=0 because of the autoAlpha but what should I to avoid that ?

 

Thanks in advance !

Link to comment
Share on other sites

assuming your mc starts on the the stage with an alpha of 1 and visible of true,

 

the first tween will tween FROM an autoAlpha of 0 TO an autoAlpha of 1.

tween = TweenMax.from(mc,.7,{x:stage.stageWidth+100+mc.width, autoAlpha:0, motionBlur:true, ease:Cubic.easeOut})

 

it will stay at and autoAlpha of 1 for 2.8 seconds but I think it is off stage.

 

and then fade TO and autoAlpha of 0.

tween = TweenMax.to(mc,.7,{x:-mc.width,autoAlpha:0, motionBlur:true, ease:Cubic.easeIn})

 

at no time in the middle of the timeline is the alpha 0.

 

From reading your code it looks like you might be moving your mc off stage to the right. that is my guess as to why you can't see it.

 

I think what you are asking is how do you make it so that the timeline always moves when you scrub... you sort of want the scrubber to ignore the delay between the tweens.

I came up with a way that isn't very flexible and will be very difficult to use with more than 1 delay but feel free to try it out.

 

say you have 2 tweens

 

tween 1 is 2 seconds long.

tween 2 is 2 seconds long but starts 3 seconds after tween 1.

 

there is a 3 second gap of no movement.

 

basically when scrubbing, if you pass the first tween (currentTime > 2) it automatically adds the amount of "dead time" to the currentTime of the timeline.

the currentTime will automatically jump to 5 seconds but there won't be any noticeable shifting or glitchiness to the user as you are just jumping over "dead" space.

 

another important factor is that the slider's maximum value is set to the duration of the timeline minus the 3 seconds of dead time.

 

 

 

its a bit much to explain, I doubt this is the best way to do it, but feel free to use my files. I can't guarantee anything.

 

when you test them, you will notice that as you scrub slowly to the right the current time will jump from 2 to 5 and the animation will appear to be continuous.

Link to comment
Share on other sites

  • 2 weeks later...

Sorry for the late response and thanks for your reply by the way !

 

I tested your file and the problem still persist when we click directly on the slider bar. I was wondering if there would a possibility with the OverwriteManager ?

 

Thanks again !

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...