• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Trying to get buttons to do a unique animation

New Here ,
Jun 13, 2022 Jun 13, 2022

Copy link to clipboard

Copied

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.

Views

56

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 15, 2022 Jun 15, 2022

Copy link to clipboard

Copied

LATEST

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");

}

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines