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 !