PDA

View Full Version : Hide object/Show Object - Same button?



Michael
07-14-2002, 05:16 PM
Is it possible to have one button on click event to show and another click (same button) to hide?...show/hide...show/hide.

<IR_ACTIONS_LIST>
<Action name="Hide Object">
<ObjectName>Text1</ObjectName>
</Action>

<Action name="Show Object">
<ObjectName>Text1</ObjectName>
</Action>
</IR_ACTIONS_LIST>

Lorne
07-14-2002, 10:36 PM
What you want is a toggle. Set a variable to true or false each time the button is clicked. (If it's true, set it to false, otherwise set it to true.)

Like so:

IF (%foo%)
// turn it off
%foo% = 0
ELSE
// turn it on
%foo% = 1
END IF

Then, add in the stuff to do the showing and hiding, depending on whether it's being toggled on or off.