The ON switch

Insert a rectangle and award it, as described above, a colour for a traffic light of your choice and enter .ON at Variables for the Change color. Enter “ON” in the input field for Content in the category Text.

In order to set the variable ON to TRUE with a mouse click on the switch, activate option ‘Toggle variable’ in category ‘Input’ and enter variable name “.ON” there. Variable keying means that when a mouse click is made on the visualization element the variable .ON is set to the value TRUE but is reset to the value FALSE when the mousekey is released again (we have created hereby a simple switch-on device for our traffic lights program).