Jump to content
Search Community

What is the proper use of includeDelay in TimelineMax?

tom.nycstudio test
Moderator Tag

Recommended Posts

Hello Jack and Greensock community - quick question

 

I've got a master timelineMax instance that contains a few child timelines... after my animation plays I want it to loop.

 

 

 

There is a function called at the end of the presentation which includes:

 

masterCircleTLM.restart({includeDelay:true});

 

Is this a proper use of 'includeDelay' ?

 

 

for your reference I'm including the code which introduces masterCircleTLM - note the delay of 8.5 seconds which I need to preserve.

 

var masterCircleTLM:TimelineMax = new TimelineMax;


masterCircleTLM.insertMultiple([
v1CircleControl,
v1lrgCircleControl,
], 8.5, TweenAlign.START, 0);
masterCircleTLM.insert(circleLeaveTimelineV1, 22);

 

big thanks!

Link to comment
Share on other sites

No no, that's a parameter not a vars object or anything. So it's as simple as:

 

masterCircleTLM.restart(true);

 

I didn't see where you defined a delay for your masterCircleTLM. Typically that is done like this:

 

var masterCircleTLM:TimelineMax = new TimelineMax({delay:8.5});

 

-OR-

 

var masterCircleTLM:TimelineMax = new TimelineMax();
masterCircleTLM.delay = 8.5;

Link to comment
Share on other sites

First, thanks for the super speedy fast reply. wow

 

Here's the code in which I believe I've specified a delay of 8.5 seconds.. (line 5 right before the TweenAlign) is this correct?

 

var masterCircleTLM:TimelineMax = new TimelineMax;
masterCircleTLM.insertMultiple([
v1CircleControl,
v1lrgCircleControl,
], 8.5, TweenAlign.START, 0);
masterCircleTLM.insert(circleLeaveTimelineV1, 22);

Link to comment
Share on other sites

No, not really - you just delayed the start time of those tweens by inserting them at the 8.5 second spot which effectively acts like a delay since those are the first/only tweens in the timeline. But the timeline itself can have a delay as well. So, for example, if you set the TimelineMax's delay to 8.5 and you ran that same code, your tweens wouldn't start the first time for 17 seconds (8.5-second delay before the TimelineMax started, and then 8.5 seconds before the virtual playhead reached the tweens on the TimelineMax). See what I mean? Have you watched the video at http://www.greensock.com/timeline-basics/ yet? If not, I'd highly recommend it :)

 

Happy tweening.

Link to comment
Share on other sites

so is there any difference apart from coder's style, in delaying a timeline and delaying the first tween in a timeline?

 

And here's a question I've been pondering.... what if a timeline is delayed a negative amount?

 

eg: firstTweenTimeline.delay = -60;

 

does the swf actually have a full minute of space added to its beginning?

 

does this cross over into other dimensions?

 

On a serious note, would there be a case where one might want a negative delay at the beginning of a swf?

 

Yes thanks I'm a fan of that tutorial movie you set up.. watched it many times.

 

thanks! t

Link to comment
Share on other sites

A negative delay? Don't even try that...you'll.....you'll....warp time and space, sending your swf into the 5th dimension. You might even reverse the polarity in your CPU causing it to sequentially undo every keystroke and mouse click you did and then implode. It might even spark a war with North Korea. :o

 

Seriously, though, a negative delay is not recommended. Technically it'll just move its startTime backwards in its parent timeline, that's all.

 

As with many things in the tweening platform, there's a lot of flexibility and many ways to skin a cat. I suppose the only benefit of using a delay on the TimelineLite/Max is that you can choose to maintain that delay or not when you restart(), but that's not really a big deal anyway because even if you built it the other way (placing the tweens at 8.5 seconds into the timeline) and you wanted to skip to their starting point after the timeline ended, you could simply use gotoAndPlay(8.5) at that point. Use whichever method seems more intuitive to you.

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