Highlighted

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

Explorer ,
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?

Adobe Community Professional
Correct answer by JoãoCésar | Adobe Community Professional

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

Views

70

Likes

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

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

Explorer ,
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?

Adobe Community Professional
Correct answer by JoãoCésar | Adobe Community Professional

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

Views

71

Likes

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

Likes

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
Reply
Loading...
Jul 10, 2020 0
Adobe Community Professional ,
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

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

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
Reply
Loading...
Jul 10, 2020 0
_tal_ LATEST
Explorer ,
Jul 10, 2020

Copy link to clipboard

Copied

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.

Likes

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
Reply
Loading...
Jul 10, 2020 0