Pressed state of a button staying in pressed state ... how?


(Eric Brace) #1

Hi Hype community,

Apologies in advance for a question that likely has a simple answer.

I have created a button in hype with a “pressed state”. When a user presses the button, I want the button to stay in the pressed state.

For instance, I have a button that has a black border in its normal state and it has a thick green border in its pressed state.

Unfortunately, the button will quickly enter its pressed state when pressed but then quickly revert to the normal state.

I want the button to stay in its pressed state once it has been pressed.

Let me know if that makes sense or if you need more details.

Thanks,

@theliteracybug


#2

Hi Eric,

Here’s a way to do this with Timelines, where a click on an object plays a timeline: Toggle button pressed state w/o JavaScript

In that timeline (Checkbox1 if you’re looking at the first button), the background color changes and an X is added to the inner HTML of the rectangle. But you could for your purposes just change the color of the button. And then, you could reset the timeline by reversing the same timeline:

39%20AM

There’s several ways to do this, but this is just one.


(Eric Brace) #3

Thanks, Daniel.

That solved my issue.

Cheers

Eric