Upvote 1

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

Answered Victor Conesa 13 years ago

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.

Best Answer
photo

Create an "onToggle" + "Show" event. See the screenshot attached.


2a96d15ab535b8b752d2c75813e31088

Replies (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

Create an "onToggle" + "Show" event. See the screenshot attached.


2a96d15ab535b8b752d2c75813e31088

Leave a Comment
 
Attach a file