Skip to main content
Participating Frequently
May 7, 2018
Question

simple question; how do I move from frame to frame with buttons on an Animate CC HTML5 canvas

  • May 7, 2018
  • 1 reply
  • 913 views

I can't make a button component work; I dragged it from the components list directly to the stage, converted it to symbol, gave it an instance name and gave it the "Click to Go to Frame and Stop" snippet.

I've tried variations of...

this.button_1.addEventListener("click", firstButton.bind(this));

function firstButton()

{

this.gotoAndStop(2);

}

what am I missing?

    This topic has been closed for replies.

    1 reply

    Legend
    May 7, 2018

    Why on earth are you using the components? Just make a button symbol and use that.

    Participating Frequently
    May 7, 2018

    Hi Clay,

    Tried that also, and it works to open a webpage but not to move to another frame......as for the component, I was just following another tutorial on YouTube for that instance....so what's wrong with my code that it won't move from frame 1 to frame 2?

    On Monday, May 7, 2018, 5:40:06 PM EDT, ClayUUID <forums_noreply@adobe.com> wrote:

    simple question; how do I move from frame to frame with buttons on an Animate CC HTML5 canvas

    created by ClayUUID in Adobe Animate CC - General - View the full discussion

    Why on earth are you using the components? Just make a button symbol and use that.

    If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/10367599#10367599 and clicking ‘Correct’ below the answer

    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:

    Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/10367599#10367599

    To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following"

    Start a new discussion in Adobe Animate CC - General by email or at Adobe Community

    For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624.

    This email was sent by Adobe Community because you are a registered user.

    You may unsubscribe instantly from Adobe Community, or adjust email frequency in your email preferences

    franciscog47374926
    Known Participant
    May 8, 2018

    To make a button move the animation to the next frame this is the way I have done it,

    Put some text or a rectangle on your scene, convert to symbol (button) and give the button an instance name (on the properties panel)

    Select your button, go to window - Actions on the code editor I suggest you use the code snippets HTML5 Canvas - Timeline navigation - Click to go to frame and play, this will add a piece of code if you double click.

    and then you just have to change the frame number that you see in between parenthesis on the this.goToandPlay(2) statement.  remember that the number is counted starting from first frame being 0 , second frame 1 and so on.

    good luck.