Skip to main content
Known Participant
July 10, 2020
Answered

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

  • July 10, 2020
  • 2 replies
  • 1697 views

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?

    This topic has been closed for replies.
    Correct answer JoãoCésar17023019

    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

    2 replies

    JoãoCésar17023019
    Community Expert
    JoãoCésar17023019Community ExpertCorrect answer
    Community Expert
    July 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

    _tal_Author
    Known Participant
    July 10, 2020

    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.

    _tal_Author
    Known Participant
    July 10, 2020

    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?