Button – Pressed have one action, Pressed again redo the action

Hi everyone,

Hope anyone can help me on this one or find a way to “hack” it.

I want to set my button when I pressed one time it will set the opacity of the elements to 30% and If I pressed again will set the opacity to 100% is it possible to make that happen? Instead of using toggle and just using a single button?

Thank you,

Best
David

Hi David!

It sounds like you want to have a single button have two functions, depending on the current state of a target widget. In which case, the best way to do so would be to use conditional logic.

In this example, I have a “Click or Tap” interaction with a “Set Opacity” action as usual. However, I included two different cases to set the target widget to either 30% or 100%. I also added an action to set the text of the target widget to “30” or “100”. This will serve as the indicator to our condition as to which state it currently is in. I included this indicator in the conditional logic in order to differentiate when to fire. Once complete the set up should look something like this:

Untitled

I have also included the example file to demonstrate this. Hope that helps!

button settling opacity.rp (45.0 KB)