Like NickRimer says, use groups.
Add your on click actions to a group, and enable disable this group when needed.
Another option could be to give them booleans to set them active.
If you have a layer appearing above the buttons, you could add a condition to the onclick action
layer "layerabovebutton" is not visible (inverted)
The latter will only be clickable if the layer above it is invisible.