Help making a toggle switch

Can anyone help me write some basic behaviors for a toggle switch? As of now I set up a boolean attribute as "isOn" set to false. Then set up an actor with an image of the button. When the conditions of mouse position is over and mouse button pressed are valid, the image of the button changes and the "isOn" attribute is set to true. This works for toggling the button on, but not toggling the button off. It seems like there is a simple way to do this, but I am stumped. Any ideas would be greatly appreciated. Thanks.
Comments
When you press the mouse button, or touch(pressed) the actor:
Change Attribute: game.Switch = (game.Switch + 1)%2
So the value of Switch is either 0 or 1. You can check for those values.
See Modulo operation.
http://en.wikipedia.org/wiki/Modulo_operation
I should've come to the forums earlier....ie. 5 Months ago!!