Skip to main content
Christopher Hotchkiss
Participant
June 13, 2022
Question

Trying to get buttons to do a unique animation

  • June 13, 2022
  • 1 reply
  • 99 views

So I want my buttons to work as such:

 

When you click on it I want it to transaition to the down position and stay in that position.

Then, when you click again it goes to the up position. 

I of course want it to cycle through the hit position as well.

 

Any help or ideas would be appreciated.

    This topic has been closed for replies.

    1 reply

    kglad
    Community Expert
    Community Expert
    June 15, 2022

    ignoring your comment about hit position (because it makes no sense):

     

    use a movieclip(eg, instance name mc) with "up" and "down" frame labels and whatever graphic you want.  then, for canvas, use:

     

    this.mc.addEventListener("click",mcF);

     

    function mcF(e){

    if(e.currentTarget.currentLabel=="up"){

    e.currentTarget.gotoAndStop("down");

    } else {

    e.currentTarget.gotoAndStop("up");

    }

    }