14 Replies Latest reply on Nov 4, 2017 12:13 PM by JosephLabrecque

    create a "mouse over" interactive button in html5 canvas

    Coachwise

      Hi there,

       

      I’m currently using the HTML5 canvas in flash Professional CC.

       

      I want to create an animated button that grows when you hover over it and then shrinks when you hover off it.

       

      I can do this in AS3 but I can’t seem to do it in the HTML5 canvas.

       

      I’ve placed the animated button in a movieclip and stopped it at the start of the movieclip timeline then added this code to try and activate it when I hover over it but it didn’t work:

       

      this.movieClip_2.addEventListener(“mouseover, fl_mouseoverToGoToAndPlayFromFrame_3.bind(this));

       

      function fl_mouseoverToGoToAndPlayFromFrame_3()

      {

          this.gotoAndPlay(2);

      }

       

      I've also tried to create a standard "button symbol" then added the animation within each action (Up, Over, Down). This didn't work either.

       

      Any help would be much appreciated!

       

      Matt