"If Then" - Command

Q&A about the latest versions
Post Reply
jimsalabim
Posts: 30
Joined: Fri Apr 21, 2017 12:51 pm

Tue Aug 18, 2020 2:47 pm

hi guys,

I am looking for a way to set an "if / then" command for an interactive button. An example: let's say I want a button that either shows or hides an interactive map. If the map is hidden, the "Fade In" command must apply, if the map is shown, the "Hide" command must apply. In the past I have solved this simply with 2 buttons, but I would like to have as few buttons as possible and also implement other things if I know how to do it. Can anyone help me here?
Branigan
Posts: 228
Joined: Tue May 19, 2020 3:43 pm

Tue Aug 18, 2020 2:59 pm

jimsalabim wrote:
Tue Aug 18, 2020 2:47 pm
hi guys,

I am looking for a way to set an "if / then" command for an interactive button. An example: let's say I want a button that either shows or hides an interactive map. If the map is hidden, the "Fade In" command must apply, if the map is shown, the "Hide" command must apply. In the past I have solved this simply with 2 buttons, but I would like to have as few buttons as possible and also implement other things if I know how to do it. Can anyone help me here?
Create a variable that is True/False, then set it to False for a hidden initial state.

Set an action on your button to use the Not Operation on it, which will toggle it on or off.

Use other logic tests that work depending on the True/False state of the button, such as swapping some text from Show to Hide etc. as well toggling the map on/off.
.
toggle_map.jpg
toggle_map.jpg (47.1 KiB) Viewed 157 times
jimsalabim
Posts: 30
Joined: Fri Apr 21, 2017 12:51 pm

Tue Aug 18, 2020 4:33 pm

Thanks a lot!!!
Post Reply