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

Is there a way to do a mouseup event on a button?

Explorer ,
Jul 10, 2020 Jul 10, 2020

Copy link to clipboard

Copied

Using Adobe Animate 20.5, with HTML5 Canvas project.

If I add this code to the frame that contains my button:

 

 

this.btnUp.addEventListener("mousedown", function() {
	console.log("mousedown!");
});

this.btnUp.addEventListener("mouseup", function() {
	console.log("mouseup!");
});

this.btnUp.addEventListener("touchend", function() {
	console.log("touchend!");
});

this.btnUp.addEventListener("click", function() {
	console.log("click!");
});

 

 

The only events that trigger are mousedown, and click.

I need the button to do something on mousedown, and undo it on mouseup. Is there a way to do that?

Views

1.2K

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

correct answers 1 Correct answer

Community Expert , Jul 10, 2020 Jul 10, 2020

Hi.

 

There isn't a mouseup event as you figured it out. It's pressup.

 

And the official reference is the one from the CreateJS official website:

https://createjs.com/docs

 

Also please notice that Animate has a default Button symbol that already has the three main mouse event types for a button: out, over, and down. If all that you need is some simple button visual effects, then maybe the default Button will be enough.

 

Please let us know if you have any other questions.

 

Regards,

JC

Votes

Translate

Translate
Explorer ,
Jul 10, 2020 Jul 10, 2020

Copy link to clipboard

Copied

It looks like there's a mousedown event, and a pressup event, but no pressdown event.

Is there a list of these events somewhere for reference?

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
Community Expert ,
Jul 10, 2020 Jul 10, 2020

Copy link to clipboard

Copied

Hi.

 

There isn't a mouseup event as you figured it out. It's pressup.

 

And the official reference is the one from the CreateJS official website:

https://createjs.com/docs

 

Also please notice that Animate has a default Button symbol that already has the three main mouse event types for a button: out, over, and down. If all that you need is some simple button visual effects, then maybe the default Button will be enough.

 

Please let us know if you have any other questions.

 

Regards,

JC

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
Explorer ,
Jul 10, 2020 Jul 10, 2020

Copy link to clipboard

Copied

LATEST

I know about the out/over/down states of buttons, but I needed to change a different symbol - not the button itself.

Thanks for the docs reference - I should really consult it more often.

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