Toggle shape on canvas to show/hide with the same button

Danny Huebsch shared this question 7 years ago
Answered

I want to click a button and have it alternate showing a shape a made on the canvas. Like toggling the shape on and off.

Comments (4)

photo
1

You can either use a variable to control the state and define conditions on the button's onClick event or place the button inside a dynamic panel with two panels, both with copies of the same button. One of the buttons can have the onClick->show shape event and the other the onClick -> hide. Then add another action to that event so that when the user clicks one button the panel that holds the other shows up.

photo
1

Now Prototyper 4.6 includes the 'toggle' event.

photo
1

What about version 7.1.1? I can't find the 'toggle' event, is there a way to access it?

photo
1

Hi Jack ,


Are you using the free version? Have you got a license?


In case you have a Justinmind license you should be able to create an "onToggle" event. See the screenshot attached.


2a96d15ab535b8b752d2c75813e31088


Best,


Sonia Durán