a variable is just a place to store a value. In the case of an integer variable, you are storing whole numbers.
It's best to start with a very simple puzzle. I would suggest using an integer to store 0 for off and 1 for on. More complex puzzles would have several values to represent more than just on and off.
with the variable set to 0 or 1, it would represent a toggle switch.
An example might be a light switch. If the user clicks on a hotspot that represents a light switch, you would check the value of the variable. If it is set to 0, then when the click on the switch, display a lit up light. If the variable is set to 1, then when the user clicks on the switch, set the light to off. Be sure to set the value of the variable each time they click on the switch.
Adventure maker allows you to do this example without writing code. In fact, I think in the AM manual, it shows the concept of turning a light on and off.
I also created a couple Youtube videos on something like this.
Simple example:
http://www.youtube.com/watch?v=BI1LiPKWETA
Sequence example:
http://www.youtube.com/watch?v=1xrLS2U-pEA