hodograph Posted February 22, 2014 Share Posted February 22, 2014 So I was trying to find a nice way to make a lot of automatic tweens (for lack of a better term) and I found the bubble example from snorkl (http://www.snorkl.tv/2010/12/timelinemax-bubbles-play-pause-and-rewind-particle-systems/) I used his code and modified it to better fit my needs (took out a lot of the randomness and the buttons) but now the clips won't tween. They are placed on the screen, but don't move at all. Also, I already had my own randomRange function defined elsewhere in my project. Heres the code: import com.greensock.*; import com.greensock.easing.*; var tl:TimelineMax=new TimelineMax({paused:true,onComplete:done}); function createWords() { //create a word (attach symbol in library with Class Bubble) and position on stage var word:words = new words(); word.y=500; word.x=randomRange(100,400); word.alpha=1; addChild(word); //create timeline for each word var nestedTl:TimelineMax = new TimelineMax(); nestedTl.insert(TweenMax.to(word,17, {y:-50, ease:Linear.easeNone})); //append new timeline very close to when the previous one started //don't even ask about the offset...k? tl.append(nestedTl, 6); } function done() { trace("the party's over"); } function init() { for (var count:Number = 0; count<50; count++) { createWords(); } } init(); WordTest.fla.zip Link to comment Share on other sites More sharing options...
Carl Posted February 22, 2014 Share Posted February 22, 2014 hmm, the only thing that jumps out is that you are adding all your nested timelines 6 seconds into the main timeline. tl.append(nestedTl, 6); Are you waiting 6 seconds? maybe try tl.append(nestedTl); If that doesn't help please post a very simple fla (zipped) that we can compile and test Link to comment Share on other sites More sharing options...
hodograph Posted February 22, 2014 Author Share Posted February 22, 2014 hmm, the only thing that jumps out is that you are adding all your nested timelines 6 seconds into the main timeline. tl.append(nestedTl, 6); Are you waiting 6 seconds? maybe try tl.append(nestedTl); If that doesn't help please post a very simple fla (zipped) that we can compile and test I was waiting the 6 seconds, but I still tried it with no delay and it still didn't work. I made a simple fla file with the symbol and the code I used and uploaded it. Link to comment Share on other sites More sharing options...
Carl Posted February 23, 2014 Share Posted February 23, 2014 Sorry, it appears your file did not get attached. Link to comment Share on other sites More sharing options...
hodograph Posted February 23, 2014 Author Share Posted February 23, 2014 Sorry, it appears your file did not get attached. It is attached to the original post. It has already been downloaded by someone else. Link to comment Share on other sites More sharing options...
Carl Posted February 23, 2014 Share Posted February 23, 2014 Oh, it looks like tl is paused and thus not playing. Try function init() { for (var count:Number = 0; count<50; count++) { createWords(); } tl.play(); } Link to comment Share on other sites More sharing options...
hodograph Posted February 23, 2014 Author Share Posted February 23, 2014 Thanks! I had tried removing the {paused:true} before I posted this, but that didn't work. Never thought about tl.play(); 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