Jump to content
Search Community

okp

Members
  • Posts

    3
  • Joined

  • Last visited

okp's Achievements

0

Reputation

  1. Yes it works for me. But I keep in mind the getLabelsArray() method in case I need some intermediate labels, might be useful! Thanks again!
  2. Hi Carl, Thanks for the reply. I knew for sure it was a simple question, but which required a more complicated answer, given the amount of different solutions I tried. You are right, the trick to add the label just after the pause (a fraction of second) works fine. When hitting Next, tl.play(tl.getLabelAfter()) jumps to the correct label and plays. However, when hitting Previous, i'd like to go to the label before the getLabelBefore() value. e.g., when playing from step2 to step3 (= step2 animation), i'd like to go to step1. So I did that : tl.play(tl.getLabelBefore(tl.getLabelTime(tl.getLabelBefore())-.1)) Not sure if it's a good way...
  3. Hi there, I'm having issues trying to add pauses and next/prev buttons to control the animation. I added pauses in the Timeline using addPause(), and addCallback to change the value of next label but i'm confused and it doesn't work... Here's my simplified code: var nextLabel:String=""; var tl:TimelineMax= new TimelineMax(); tl.addLabel("step1"); tl.addCallback(setNext,"step1",["step2"]) tl.append( new TweenMax(my_MC,2,{alpha:1})); tl.append( new TweenMax(my_MC,1,{x:200})); tl.addPause(); tl.addLabel("step2") tl.addCallback(setNext,"step2",["step3"]) tl.append( new TweenMax(my_MC,2,{alpha:.5})); tl.append( new TweenMax(my_MC,1,{x:400})); tl.addPause(); tl.addLabel("step3") tl.append( new TweenMax(my_MC,2,{alpha:1})); tl.append( new TweenMax(my_MC,1,{y:200})); function setNext(t):void{ nextLabel=t; } my_NextButton.addEventListener(MouseEvent.CLICK,goToStep) function goToStep(e:MouseEvent):void{ tl.play(nextLabel) } I think i'm not doing things in the correct order. Any advices ? Thanks !
×
×
  • Create New...