Skip to main content
Known Participant
March 15, 2018
Answered

Understanding how to add hover action to buttons on a Animate CC Canvas

  • March 15, 2018
  • 1 reply
  • 7452 views

I have a simple button that I need to go to frame 25 when hovered over in Animate CC.

Can anyone offer some simple instructions?

Is there any way to upload the file?

Thanks

    This topic has been closed for replies.
    Correct answer albertd9194959

    There is the "window/Code Snippet" window, but its limited and you still need to poke around with the script it creates to get what you want..... based on the link, the bellow goodness does whats needed...remember animate isn't a wysiwyg program when it comes to the scripting, would be interesting to have a node based system like "playmaker" for unity for instance....

    this.stop();

    root = this;

    stage.enableMouseOver();

    this.MYBUTTON.addEventListener("mouseover", MYFUNCTION);

    function MYFUNCTION()

    {

    root.gotoAndPlay(FRAMENUMBER);

    }

    Regards,

    1 reply

    albertd9194959
    Inspiring
    March 15, 2018

    Hello,

    Depends, are you using ActionScript3 or HTML5 Canvas document ?

    Here is an html5 sollution fro kglad:

    create a "mouse over" interactive button in html5 canvas

    Regards,

    Known Participant
    March 15, 2018

    Thanks but that just confuses the situation. Isn’t there a simple action for Canvas to gotoandplay or go toad stop ?

    Sent from my iPad

    albertd9194959
    albertd9194959Correct answer
    Inspiring
    March 15, 2018

    There is the "window/Code Snippet" window, but its limited and you still need to poke around with the script it creates to get what you want..... based on the link, the bellow goodness does whats needed...remember animate isn't a wysiwyg program when it comes to the scripting, would be interesting to have a node based system like "playmaker" for unity for instance....

    this.stop();

    root = this;

    stage.enableMouseOver();

    this.MYBUTTON.addEventListener("mouseover", MYFUNCTION);

    function MYFUNCTION()

    {

    root.gotoAndPlay(FRAMENUMBER);

    }

    Regards,