Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

gotoAndStop timeline navigation ends suddenly

New Here ,
Mar 31, 2019 Mar 31, 2019

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);

}

399
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 01, 2019 Apr 01, 2019

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.

Translate
Community Expert ,
Apr 01, 2019 Apr 01, 2019
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines