Hi,
I have a left and right arrow that play/reverse between 5 (have only 3 built so far) scenes.
I inserted pauses:
timeline.addCallback(Pause, boxDur*4); // 1st pause
timeline.addCallback(Pause, boxDur*5); // 2nd pause
with a timeline.pause(); callBack function where needed.
When you click rArrow (on stage), it plays to the next pause. When you click lArrow (on stage), it reverses to the previous pause -- pretty simple right?
Well, sometimes, only sometimes, does the play and reverse functions fail to work so I have to click(reverse) all the way back to the beginning of the timeline instance to get it to "reset" and actually play/reverse.
I'm tracing the currentProgress of the timeline instance and getting an output of inconsistent numbers (scenes 1 to 3 and back to 1):
0
0.8360000000000005
1
0.7919999999999998
0
0.8360000000000003
1
0.7919999999999998
Here is my timeline code:
//***************** SCENE 2 *************************************************************
timeline.insert(TweenMax.from(warPraCopy, dur, {x:424.8, y:617.0}));
timeline.insert(TweenMax.from(box1, dur, {x:464.1, y:469.9}));
timeline.insertMultiple([TweenMax.from(box2, boxDur, {x:400, alpha:0, delay:boxDur}),
TweenMax.from(box3, boxDur, {x:400, alpha:0, delay:boxDur*2}),
TweenMax.from(box4, boxDur, {x:400, alpha:0, delay:boxDur*3})]);
//***************** SCENE 3 *************************************************************
timeline.appendMultiple([TweenMax.to(box1, boxDur, {x:74.7}),
TweenMax.to(box2, boxDur, {x:336.8, y:383.1}),
TweenMax.to(box3, boxDur, {x:551.3, y:385.1, alpha:.2}),
TweenMax.to(box4, boxDur, {x:733.5, y:397.7, alpha:.2})]);
Here are my MOUSE_DOWN callBack functions for each arrow:
function skipForw (e:MouseEvent) {
currFrame++;
if (currFrame <=5) {
timeline.play();
lArrow.gotoAndStop(currFrame);
rArrow.gotoAndStop(currFrame);
if (currFrame > 1)
lArrow.visible = true;
}
else
currFrame = 5;
trace(timeline.currentProgress);
}
function skipBack (e:MouseEvent) {
currFrame--;
if (currFrame >=1) {
timeline.reverse();
lArrow.gotoAndStop(currFrame);
rArrow.gotoAndStop(currFrame);
if (currFrame == 1)
lArrow.visible = false;
}
else
currFrame = 1;
trace(timeline.currentProgress);
}
Can you please explain if I'm doing anything wrong? Doing this for work and would be a HUGE help for future projects. BTW I'm a BIG fan of your work and am extremely appreciative of your contributions to the Flash community.
Thanks!
Ribs