Skip to main content
Participant
June 8, 2022
Question

GoToAndPlay not working

  • June 8, 2022
  • 1 reply
  • 247 views

Hello!

I am working on an excerise that has four buttons. Each button is supposed to go to a different frame and play from that frame. Currently all four buttons send the animation to the same frame, though the code has them going to different frames. Each button is on its own layer, and the code for each is as follows:

 

this.button_1.addEventListener("click", fl_ClickToGoToAndPlayFromFrame.bind(this));
function fl_ClickToGoToAndPlayFromFrame()
{ this.gotoAndPlay(27);
}

 

With the number "27" changing based on the button. 

I currently have all actions on the first frame, and I'm adding a screenshot of my project. I can't figure out what is going on, any help would be appreicated!

    This topic has been closed for replies.

    1 reply

    Community Expert
    June 8, 2022

    try using code snippets. also make sure to select the movieclip and give it an instances name.