Going back and forth through the Main Timeline
Dear all,
I'm working on a HTML5 canvas.
I have two buttons.
By clicking on the first button (BUTTON 1) I go to the next fifth frame and stop there.
By clicking the other button (BUTTON 2) I go back to the first frame (number 0) wherever currentframe the animation is.
Actually, I used this codes:
BUTTON 1:
exportRoot.BUTTON 1.addEventListener("click", fl_ClickToGoToAndStopAtFrame_1.bind(this));
function fl_ClickToGoToAndStopAtFrame_1() {
exportRoot.gotoAndStop(exportRoot.currentFrame + 5);
}
BUTTON 2:
exportRoot.BUTTON 2.addEventListener("click", fl_ClickToGoToAndStopAtFrame_2.bind(this));
function fl_ClickToGoToAndStopAtFrame_2() {
exportRoot.gotoAndStop(0);
}
However it happens that when I click on BUTTON 2 it's ok: the animation goes to frame 0
BUT
afterwards, if I newly click on BUTTON 1 it skips several frames: it does not go to frame 5.
What happens?
Do I have to reset the timeline when I go back to frame 0?
I don't really know what happens
Thank you in advance
