Jump to content
Search Community

Zero Duration Tweens in TimelineMax

DagShot test
Moderator Tag

Recommended Posts

Hey Folks,

 

I'm currently building a long animation movie with TimelineMax for the sake of slider implementation.

the different Parts (scenes) are each organized in different MCs and i keep them off stage as long they aren't supposed to be visible.

i want to place them to x:0/y:0 as soon as their timelineMax is to be activated, utilizing a zero duration TweenMax:

 

szeneXY.append( TweenMax.to(myContent, 0, {x:0, x:0}));

 

witch doesn't work, all these Tweens seem to be render immediately, and as a result all the mcs are visible from start.

setting alpha:0 is no option because it slows down performance massivey.

setting the duration of the tweens to .01 is still producing a slight movement animation eventually, witch isn't bulletproof enough.

i already played around with the renderImmediately property, but wasn't lucky.

 

thanks for reading

any thoughts?

Link to comment
Share on other sites

i already played around with the renderImmediately property, but wasn't lucky.

 

could be a simple mistake above, but the property is immediateRender.

immediateRender:false is what you want.

 

as a bit of a hack, you could try an even lower duration like .001 (but that shouldn't be necessary immediateRender:false should do the trick).

 

if that doesn't work please provide a very simplified FLA (cs5 or lower) that only has enough code/assets to illustrate the problem. you don't need to provide your production files.

 

thanks

Link to comment
Share on other sites

this sounds promising!

 

I'm pretty sure i used the right property because i used the documentation; but i assumed that the immediateRender property was set to false by default.

i guess it automatically is set to true, when the duration of the tween is put to 0, right?

i will test it in an hour or so.

and let you know if it worked.

Link to comment
Share on other sites

yes, for most tweens immediateRender is set to false by default, but it gets interesting with 0-duration tweens because since they have no duration, TweenLite thinks "oh no, this tween's duration has already expired I better render it right now!". setting immediateRender to false will remedy this as per the docs:

 

immediateRender : Boolean Normally when you create a tween, it begins rendering on the very next frame (when the Flash Player dispatches an ENTER_FRAME event) unless you specify a delay. This allows you to insert tweens into timelines and perform other actions that may affect its timing. However, if you prefer to force the tween to render immediately when it is created, set immediateRender to true. Or to prevent a tween with a duration of zero from rendering immediately, set immediateRender to false.

 

you can run a very simple test:

 

test 1: alpha of mc is set immediately:

var main_timeLine:TimelineMax = new TimelineMax({});

main_timeLine.append(TweenMax.to(mc, 2, {x:200}))
main_timeLine.append(TweenMax.to(mc, 0, {alpha:.5}));

 

test 2: alpha of mc waits to be changed

var main_timeLine:TimelineMax = new TimelineMax({});

main_timeLine.append(TweenMax.to(mc, 2, {x:200}))
main_timeLine.append(TweenMax.to(mc, 0, {alpha:.5, immediateRender:false}));

 

if your file continues to not work as expected, please post a simple example and we will get it all sorted.

 

-c

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...