L21 Button States: Visited: How do I get it to work?
January 4, 2022 12:00 AM
Hi Support Team!
I have L21 and am working in button states. When I select a button it shows as selected, but when I click on another button the mentioned does not change to visited. It remains as Selected. I have "Selected" and "Visited" enabled in the properties as well as the standard four. Is there something else I need to do?
Thank you!
Discussion (5)
Hello phale,
The short answer is you have to use an action to change states.
This may be more information than you need, and there may be others who have a better/different way to do it, but may this help new users who see this as well.
When I do something like this I use a variable for each button and a variable to determine which button is active.
For all, I set the initial value to 0, and retain variable value between session is unchecked
Example for two buttons:
- Button1Viewed
- Button2Viewed
- ButtonState
Once I have buttons and objects (in groups) on page I set up an action group to Toggle Groups and States.
In the following, when you see X, it stands for the button number.
Important: The order of action 1 and action 2 makes a difference, if it's switched, the button state will be Visited instead of Selected.
For each button:
Action 1: SetStateButtonXVisited
- Action: Set State
- Target: ButtonX
- State: Visited
- Condition:
- Variable: ButtonXViewed
- Relationship: Equal To
- Value: 1
Action 2: SetStateButtonXSelected
- Action: Set State
- Target: ButtonX
- State: Selected
- Condition:
- Variable: ButtonState
- Relationship: Equal To
- Value: X
The rest of the actions in this action group are used to show/hide objects based on the ButtonState.
The button actions as follows:
In the following, when you see X, it stands for the button number.
- Action 1 (SetButtonXViewed)
- Trigger: Mouse Click
- Action: Modify Variable
- Target: ButtonXViewed
- Type: Set Equal To
- Value: 1
Action 2 (SetButtonStateX)
- Trigger: Mouse Click
- Action: Modify Variable
- Target: ButtonState
- Type: Set Equal To
- Value: X
- Condition:
- Variable: ButtonState
- Relationship: Not Equal To
- Value: X
- Else Action:
- Target: ButtonState
- Type: Set Equal To
- Value: 0
Action 3 (RunToggle)
- Trigger: Mouse Click
- Action: Run Action Group
- Target: Toggle
If you need to have a reset on the page.
Add an action group (ResetButonState) with actions for each button:
In the following, when you see X, it stands for the button number.
- Action: Modify Variable
- Target: ButtonXViewed
- Type: Set Equal To
- Value: 0
Action 2: SetStateButtonXNormal
- Action: Set State
- Target: ButtonX
- State: Normal
Then add a page action as follows:
Action:(RunResestButtonState)
- Trigger: Show
- Action: Run Action Group
- Target: ResetButtonState
Hope this helps!
Chrystal
@chrystalb21
Bummer; I thought the answer would be simpler, as with the Normal, Over and Down states. But I get it. I will give your method a whirl. Thank you SO much for your time and support!
Warmest Regards,
Patty
Hi Phale,
If you add all of your buttons to a group, the states should work the way you expect. This is one of the best improvements in L21!
Good luck!
@susanmacnab Now that rocks! Go L21! Thank you Susan!
Follow-up: The buttons states work beautifully in Google Chrome and Firefox, but not in Microsoft Edge. My company's training is done from Microsoft Edge. #eyetwitching