0
votes

So heres my situation.

I have a movieclip which has a button inside it. A stop command on the first frame prevents the clip from playing by default and pressing the button results in it playing once. Now once the animation is finished I want to go another frame in a different scene.

Unfortunately the gotoandplay command doesn't seem to do anything.

To clarify the button is within a movieclip. I wanted to make a pop up menu.

1

1 Answers

0
votes

In the following example, the gotoAndStop() function is used to move your playhead to frame 3 of Scene 2. This code needs to be placed on the main timeline:

myButton.onPress = function():Void {
    gotoAndStop("Scene 2", 3);
}

If your button myButton is in a movie clip myMovieClip, you need to target it:

myMovieClip.myButton.onPress = function():Void {
    gotoAndStop("Scene 2", 3);
}

Remark

You can use the scene parameter only on the root timeline, not within timelines for movie clips or other objects in the document.

Adobe help about: jumping to a frame or scene.