Copy link to clipboard
Copied
I am quite new to animate cc and especially AS3. I am trying to make a simple kiosk-solution based on timeline-navigation from frame to frame for Adobe Air. I simply use gotoAndStop (framenumber) to get from one frame to another (which in the end should contain the same video file, that will then play again). But somehow, whenever I test the file, I can only move this far (frame numbers), and then it just ends without moving further: 1-5-10-5. Ideally, after the initial 1-5-10, I would like each mouse-click to continue moving from 10-5-10-5-10-5-10-5 and so on ...
Can someone tell me why it stopscompletely, when it reaches fram 5 the second time, and also what I should do to solve the problem?
Sorry, but I can't figure out how to view the whole code, so I've just copied the actions for each frame hereunder:
Frame 1:
stage.displayState = StageDisplayState.FULL_SCREEN
/* Stop at This Frame
The Animate timeline will stop/pause at the frame where you insert this code.
Can also be used to stop/pause the timeline of movieclips.
*/
stop();
/* Click to Go to Frame and Stop
Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.
Can be used on the main timeline or on movie clip timelines.
Instructions:
1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.
*/
pop.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame);
function fl_ClickToGoToAndStopAtFrame(event: MouseEvent): void {
gotoAndStop(5);
}
Frame 5:
/* Click to Go to Frame and Stop
Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.
Can be used on the main timeline or on movie clip timelines.
Instructions:
1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.
*/
pop.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_2);
function fl_ClickToGoToAndStopAtFrame_2(event: MouseEvent): void {
gotoAndStop(10);
}
Frame 10:
/* Click to Go to Frame and Stop
Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.
Can be used on the main timeline or on movie clip timelines.
Instructions:
1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.
*/
pop.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_3);
function fl_ClickToGoToAndStopAtFrame_3(event: MouseEvent): void {
gotoAndStop(5);
}
when you reach frame 5 the first time, pop has two listeners. when you reach it the 2nd time, it has four listeners. ie, your code is a mess and the only thing that's unexpected is your code works the way you want the first four times you click pop.
to remedy, assign 3 different instance names for your button in your 3 keyframes and change the names in your code accordingly, or remove the previous listeners in frames 5 and 10.
Copy link to clipboard
Copied
when you reach frame 5 the first time, pop has two listeners. when you reach it the 2nd time, it has four listeners. ie, your code is a mess and the only thing that's unexpected is your code works the way you want the first four times you click pop.
to remedy, assign 3 different instance names for your button in your 3 keyframes and change the names in your code accordingly, or remove the previous listeners in frames 5 and 10.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now