Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
timaging

timelineLite repeat not working

Recommended Posts

Hi,

 

I need to create a screensaver. I have this code now, but it doesn't repeat. In addition to that, the delay halfway through doesn't delay the animation. I can send you the file, but there's not much else to it other than the import calls, and an array so that everything start at 0 opacity. ALSO I'm not sure which icon above is the right button to hit in order for it to just show up as code:

 

 

TweenMax.allTo(introClips, 0, {alpha:0});

 
 
var mainIntroIn:TimelineLite = new TimelineLite({repeat:2});
 
 
mainIntroIn.appendMultiple([new TweenLite(LMlogoH,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(awardLogo,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0101,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0102,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0103,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0104,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0105,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0106,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0107,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0108,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0109,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0110,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0111,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0112,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0113,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0114,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0115,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0116,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0117,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0118,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0119,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0120,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0121,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0122,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0123,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0124,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0125,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0126,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0127,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0128,  1, {alpha:1, ease:Quad.easeInOut}),
  new TweenLite(line01,  1, {alpha:1, ease:Quad.easeInOut}),
  new TweenLite(s0129,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0130,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0131,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0132,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0133,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0134,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0135,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0136,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0137,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0138,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0139,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0140,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0141,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0142,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenLite(s0143,  1, {alpha:1, ease:Quad.easeInOut}),
  new TweenLite(s0144,  1, {alpha:1, ease:Quad.easeInOut}),
  new TweenLite(line02,  1, {alpha:1, ease:Quad.easeInOut}),
  
  new TweenLite(LMlogoH,  1, {alpha:0, ease:Quad.easeInOut, delay:2}),
                           new TweenLite(awardLogo,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0101,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0102,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0103,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0104,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0105,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0106,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0107,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0108,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0109,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0110,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0111,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0112,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0113,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0114,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0115,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0116,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0117,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0118,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0119,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0120,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0121,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0122,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0123,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0124,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0125,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0126,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0127,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0128,  1, {alpha:0, ease:Quad.easeInOut}),
  new TweenLite(line01,  1, {alpha:0, ease:Quad.easeInOut}),
  new TweenLite(s0129,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0130,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0131,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0132,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0133,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0134,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0135,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0136,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0137,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0138,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0139,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0140,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0141,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0142,  1, {alpha:0, ease:Quad.easeInOut}),
                           new TweenLite(s0143,  1, {alpha:0, ease:Quad.easeInOut}),
  new TweenLite(s0144,  1, {alpha:0, ease:Quad.easeInOut}),
  new TweenLite(line02,  1, {alpha:0, ease:Quad.easeInOut})], 0, TweenAlign.START, 0.1);

 

 

 

 

Link to comment
Share on other sites

OK, so changing it to MAX instead of LITE seems to have worked, but the delay in the middle still doesn't work. Any suggestions on how I can do that?

 

Thank You!!

Dave

 

Link to comment
Share on other sites

I also just tried the information on this on this page:

 

http://greensock.com/timelinemax-as

 

BUT it starts with this:

var myTimeline:TimelineMax = new TimelineMax({onComplete:myFunction});

 

and throws an error: "access of undefined property myFunction

 

VERY frustrating that all the AS3 documentation is now replaced with .js stuff. I have a hard enough time figuring this out and there's no way I can translate this. This job is due on Monday and I can't for the life of me figure out what should be fairly simple. 

 

 

 

Dave

Link to comment
Share on other sites

and this time I tried going old school, so that I could get the delay working, but now it doesn't repeat because it's not in a timeline:

 

 

 
TweenMax.to(LMlogoH, 1, {alpha:2, ease:Quad.easeInOut});
TweenMax.to(awardLogo, 1, {alpha:2, ease:Quad.easeInOut, delay:.125});
TweenMax.to(s0101, 1, {alpha:2, ease:Quad.easeInOut, delay:.25});
TweenMax.to(s0102, 1, {alpha:2, ease:Quad.easeInOut, delay:.325});
TweenMax.to(s0103, 1, {alpha:2, ease:Quad.easeInOut, delay:.5});
TweenMax.to(s0104, 1, {alpha:2, ease:Quad.easeInOut, delay:.625});
TweenMax.to(s0105, 1, {alpha:2, ease:Quad.easeInOut, delay:1});
TweenMax.to(s0106, 1, {alpha:2, ease:Quad.easeInOut, delay:1.125});
TweenMax.to(s0107, 1, {alpha:2, ease:Quad.easeInOut, delay:1.25});
TweenMax.to(s0108, 1, {alpha:2, ease:Quad.easeInOut, delay:1.325});
TweenMax.to(s0109, 1, {alpha:2, ease:Quad.easeInOut, delay:1.5});
TweenMax.to(s0110, 1, {alpha:2, ease:Quad.easeInOut, delay:1.625});
TweenMax.to(s0111, 1, {alpha:2, ease:Quad.easeInOut, delay:2});
TweenMax.to(s0112, 1, {alpha:2, ease:Quad.easeInOut, delay:2.125});
TweenMax.to(s0113, 1, {alpha:2, ease:Quad.easeInOut, delay:2.25});
TweenMax.to(s0114, 1, {alpha:2, ease:Quad.easeInOut, delay:2.325});
TweenMax.to(s0115, 1, {alpha:2, ease:Quad.easeInOut, delay:2.5});
TweenMax.to(s0116, 1, {alpha:2, ease:Quad.easeInOut, delay:2.625});
TweenMax.to(s0117, 1, {alpha:2, ease:Quad.easeInOut, delay:3});
TweenMax.to(s0118, 1, {alpha:2, ease:Quad.easeInOut, delay:3.125});
TweenMax.to(s0119, 1, {alpha:2, ease:Quad.easeInOut, delay:3.25});
TweenMax.to(s0120, 1, {alpha:2, ease:Quad.easeInOut, delay:3.5});
TweenMax.to(s0121, 1, {alpha:2, ease:Quad.easeInOut, delay:3.625});
TweenMax.to(s0122, 1, {alpha:2, ease:Quad.easeInOut, delay:4});
TweenMax.to(s0123, 1, {alpha:2, ease:Quad.easeInOut, delay:4.125});
TweenMax.to(s0124, 1, {alpha:2, ease:Quad.easeInOut, delay:4.25});
TweenMax.to(s0125, 1, {alpha:2, ease:Quad.easeInOut, delay:4.325});
TweenMax.to(s0126, 1, {alpha:2, ease:Quad.easeInOut, delay:4.5});
TweenMax.to(s0127, 1, {alpha:2, ease:Quad.easeInOut, delay:4.625});
TweenMax.to(s0128, 1, {alpha:2, ease:Quad.easeInOut, delay:5});
TweenMax.to(line01, 1, {alpha:2, ease:Quad.easeInOut, delay:5.125});
TweenMax.to(s0129, 1, {alpha:2, ease:Quad.easeInOut, delay:5.25});
TweenMax.to(s0130, 1, {alpha:2, ease:Quad.easeInOut, delay:5.325});
TweenMax.to(s0131, 1, {alpha:2, ease:Quad.easeInOut, delay:5.5});
TweenMax.to(s0132, 1, {alpha:2, ease:Quad.easeInOut, delay:5.625});
TweenMax.to(s0133, 1, {alpha:2, ease:Quad.easeInOut, delay:6});
TweenMax.to(s0134, 1, {alpha:2, ease:Quad.easeInOut, delay:6.125});
TweenMax.to(s0135, 1, {alpha:2, ease:Quad.easeInOut, delay:6.25});
TweenMax.to(s0136, 1, {alpha:2, ease:Quad.easeInOut, delay:6.325});
TweenMax.to(s0137, 1, {alpha:2, ease:Quad.easeInOut, delay:6.5});
TweenMax.to(s0138, 1, {alpha:2, ease:Quad.easeInOut, delay:6.625});
TweenMax.to(s0139, 1, {alpha:2, ease:Quad.easeInOut, delay:7});
TweenMax.to(s0140, 1, {alpha:2, ease:Quad.easeInOut, delay:7.125});
TweenMax.to(s0141, 1, {alpha:2, ease:Quad.easeInOut, delay:7.25});
TweenMax.to(s0142, 1, {alpha:2, ease:Quad.easeInOut, delay:7.325});
TweenMax.to(s0143, 1, {alpha:2, ease:Quad.easeInOut, delay:7.5});
TweenMax.to(s0144, 1, {alpha:2, ease:Quad.easeInOut, delay:7.625});
TweenMax.to(line02, 1, {alpha:2, ease:Quad.easeInOut, delay:8});
Link to comment
Share on other sites

it always helps to see a reduced test case, of all the code you posted I could only find one delay.

However it appears you are using align mode of start which ignores delays

 

align : String - Only used in conjunction with the tweens special property when multiple tweens are to be inserted immediately. The value simply gets passed to the add() method. The default is "normal". Options are:
"sequence": aligns the tweens one-after-the-other in a sequence
"start": aligns the start times of all of the tweens (ignores delays)
"normal": aligns the start times of all the tweens (honors delays)
 
 
perhaps normal is what you want.
Link to comment
Share on other sites

Hi Carl,

 

Normal did not work either... here is a shortened version. I also did try reading over that page and I couldn't figure it out. I think I must have spent 3 hours trying to search for the answer. Also note that normal is case sensitive... it didn't work as lower case, so that could be an issue too with why this isn't workin:

 

var mainIntroIn:TimelineMax = new TimelineMax({repeat:-1});

 
 
 
mainIntroIn.appendMultiple([new TweenMax(LMlogoH,  1, {alpha:1, ease:Quad.easeInOut}),
 
  
         new TweenMax(line02,  1, {alpha:1, ease:Quad.easeInOut, delay:2}),
  
 
                           new TweenMax(s0101,  1, {alpha:0, ease:Quad.easeInOut}),
 
 
                           new TweenMax(awardLogo,  1, {alpha:0, ease:Quad.easeInOut})], 0, TweenAlign.NORMAL, 0.1);
Link to comment
Share on other sites

ok, well it looks like I have something working. In my head, this doesn't make sense but I just tried it and it does what I need. I'm basically trying to add pauses within the timeline. Pause doesn't actually do that, because it doesn't look like you can tell it when to start again, or at least that's how I read it because there isn't an example of that:

 

var mainIntroIn:TimelineMax = new TimelineMax({repeat:-1});

 
 
 
mainIntroIn.appendMultiple([new TweenMax(label,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenMax(label,  1, {alpha:1, ease:Quad.easeInOut}),
                           new TweenMax(label,  1, {alpha:1, ease:Quad.easeInOut}),
      
 
                           new TweenMax(label,  1, {alpha:0, ease:Quad.easeInOut, delay:6}),
                           new TweenMax(label,  1, {alpha:0, ease:Quad.easeInOut, delay:6}),
                           new TweenMax(label,  1, {alpha:0, ease:Quad.easeInOut, delay:6})], 0, TweenAlign.NORMAL, 0.1);
Link to comment
Share on other sites

There are a few methods baked into the API that will save you a TON of time.

I strongly suggest you read over the TimelineLite and TimelineMax docs.

 

What you are doing in 40 lines of code can be done in 2.

 

It appears you are doing the same exact animation effect on multiple things which is why we have the stagger methods.

var items = [item1, item2, item3, item4, item5] // you can put a 1000 items in here

var tl = new TimelineLite();

//fade in each item with 0.25 seconds between the start times
tl.staggerTo(items, 1, {alpha:1, ease:Quad.easeInOut}, 0.25);

to pause a timeline you can use the addPause() method, but it seems like you just want some dead space / time between animations. in this case you just need to use the position parameter to specify how much time you want between animations

tl.to(item1, 1, {x:200})
  .to(item2, 1, {x:200}, "+=4") // add this 4 seconds later

Definitely watch this video http://greensock.com/position-parameter 

Yes, it's for JavaScript but the syntax is EXACTLY the same for ActionScript. 

 

with staggers and proper use of the  position parameter you could cut most of your code down immensely

 

var wordsInSentence1 = [array of things ... ];
var wordsInSentence2 = [array of things ... ];

//fade in each item with 0.25 seconds between the start times
tl.staggerTo(wordsInSentence1, 1, {alpha:1, ease:Quad.easeInOut}, 0.25);
//do the same thing to sentence2 4 seconds later
.staggerTo(wordsInSentence2, 1, {alpha:1, ease:Quad.easeInOut}, 0.25, "+=4");

Be sure you have the link to the recent docs:

http://api.greensock.com/as/

it looks like you are using a lot of the old stuff from v11.

  • Like 1
Link to comment
Share on other sites

yeah, I read over the docs, poured over all kinds of stuff and could never figure out how to apply it to what I was doing. I'll look again.

 

I think what I really need is a base course in scripting. Online courses don't work for me though. I need to be able to ask questions along the way...

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