LEL Posted September 9, 2009 Share Posted September 9, 2009 This might be stretching it...but... Is there a way to create a label array and call a "label next" or a "label previous" I'm using TimelineMax. Thanks! Lisa Link to comment Share on other sites More sharing options...
GreenSock Posted September 9, 2009 Share Posted September 9, 2009 Your wish is my command, Lisa I just updated the platform and added a "currentLabel" property to TimelineMax as well as getLabelAfter() and getLabelBefore() methods. It also has a getLabelTime() method. So to get the next label after 2-seconds for example, you'd do myTimeline.getLabelAfter(2); http://blog.greensock.com/v11beta/ Enjoy! Link to comment Share on other sites More sharing options...
LEL Posted September 11, 2009 Author Share Posted September 11, 2009 Thank yoU!!! I updated my "com/greensock" folder and tried using this: arrowRightBtn.addEventListener(MouseEvent.CLICK, rtBtn01); arrowRightBtn.buttonMode=true; arrowRightBtn.useHandCursor=true; function rtBtn01(event:MouseEvent) { myTimeline.getLabelAfter(); } and i'm getting an error: 1061: Call to a possibly undefined method getLabelAfter through a reference with static type com.greensock:TimelineMax. Link to comment Share on other sites More sharing options...
GreenSock Posted September 11, 2009 Share Posted September 11, 2009 Maybe you need to clear your cache - I just double-checked and the zip that's up there does indeed have TimelineMax with a getLabelAfter() method. Keep in mind that you need to feed a time into the function, like myTimeline.getLabelAfter(2). http://blog.greensock.com/v11beta/ Link to comment Share on other sites More sharing options...
LEL Posted September 11, 2009 Author Share Posted September 11, 2009 hrmmm I'm testing while working in flash. Link to comment Share on other sites More sharing options...
GreenSock Posted September 11, 2009 Share Posted September 11, 2009 No, I meant that you needed to download the latest version of the classes. When you downloaded previously, your browser may have had an old version cached. Please clear your browser cache, then re-download the classes from http://blog.greensock.com/v11beta/, replace your local files, delete your ASO files, and retry publishing in Flash. Link to comment Share on other sites More sharing options...
LEL Posted September 11, 2009 Author Share Posted September 11, 2009 it was the ASO files... its working now ... but not functioning like I'd like it to. I'm sure it's my error when I click an arrow, I'd like for it to go to the next label in the timeline. Here's my code: function rtBtn01(event:MouseEvent) { myTimeline.getLabelAfter(1); myTimeline.paused=! myTimeline.paused; } any idea what I'm doing wrong? Link to comment Share on other sites More sharing options...
GreenSock Posted September 11, 2009 Share Posted September 11, 2009 If you want to get the next label after the current time, you'd do: myTimeline.getLabelAfter(myTimeline.currentTime); I considered having a getNextLabel(), but it wouldn't be as flexible as getLabelAfter() because getLabelAfter() doesn't depend on the timeline to be at a certain point - you can search for next/previous labels anytime/anywhere. Keep in mind that getLabelAfter() returns a String - the name of the label. It doesn't actually make the timeline play to that point. If you want to make it play to that point, you could do: var label:String = myTimeline.getLabelAfter(myTimeline.currentTime); var targetTime:Number = myTimeline.getLabelTime(label); var duration:Number = Math.abs(targetTime - myTimeline.currentTime); TweenLite.to(myTimeline, duration, {currentTime:targetTime, ease:Linear.easeNone}); EDIT: I just added a tweenTo() method to TimelineMax that handles this for you! So it's as easy as myTimeline.tweenTo("myLabel") Link to comment Share on other sites More sharing options...
LEL Posted September 11, 2009 Author Share Posted September 11, 2009 If I have another kid, I'm naming him Jack Thank you so much for your help! 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