KLWP: Show/hide a layer by a user action

I would show or hide a layer by a some kind of user action except swiping eg. tapping an object, but I don't find a way to do it.

Is it possible and if yes in which way?


1) add a global var type switch

2) add an object like a shape

3) for that object create a touch action "toggle global switch" ... the same created in step 1

4) set the layer visibility controlled by a formula that checks the state of the switch

done! :-)