Create the item you want to use as the button (the button object or a sprite for example) Give it an instance variable called ONOFF (could be anything you want) and set it as BOOLEAN. Then on clicked with the mouse use the TOGGGLE BOOLEAN option. This will switch the FALSE (default value) to TRUE. Clicking again will switch it back ... and so on.
You just need to test for the value of the instance boolean variable.
Easier to show that describe so I knocked this up :) Hope it helps.CAPXDEMO