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?
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:
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
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?
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:
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
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.