Forum Discussion

DanielLeMay's avatar
DanielLeMay
Community Member
9 days ago
Solved

Problem with States on Custom Buttons

I am trying to create a tabbed interaction. I am struggling with the states of my four tabs. Tab 1 is behaving differently than tabs 2, 3 and 4. In all tabs normal and hover work as expected. For tabs 2, 3 and 4 the state changes to selected (darker red with a dark red top border) when clicked, then when the mouse moves away, they change to visited (teal). If I revisit one of these tabs, it stays teal but adds the dark red upper border. Tab 1 changes to selected when click but does not change to visited until I click another tab. If I reselect tab 1 it changes to the set selected stated (darker red with a dark red upper boarder). I have all buttons in button set 1. I could solve this, but I need this slide to be locked until the learner views all four tabs (Yes, I know. That decision is out of my hands). I was using the visited stated as part of the conditional to move forward. I am pretty sure I am overlooking what I did to cause button 1 to behave differently than the other three, but I cannot find it. I have attached a mocked file for reference. Any ideas would be greatly appreciated.

  • Button glitches happen. Sometimes, as Nedim​ pointed out, creating new ones fixes the glitch.

    I don't think variables are needed for tracking in this situation, though. When an object has a Selected state and a Visited state, a trigger will recognize it as Visited even though it will show as Selected when first clicked. (Yup. They made the program smart enough to know that an object that's been selected has also been visited. 🤣)

    • If the object isn't in a button set, it will toggle between Visited and Selected on subsequent clicks. 
    • If the object is in a button set, it will change to Visited when another object in the button set is Selected

     

    Here's more info about built-in states: PRIMER: Take advantage of built-in states | E-Learning Heroes 

5 Replies

  • CarlFink1's avatar
    CarlFink1
    Community Member

    I notice that both button 1 and button 2 show layer Tab 2, FWIW.

  • Nedim's avatar
    Nedim
    Community Member

    I think you should consider adding variables to track the visited layers instead. The last clicked button will never change to the Visited state unless another button is clicked.

    As for the button states, it appears to be a glitch that most likely occurred while recreating the buttons. I duplicated the Tab 1 button and used it for the other three tabs.

    Please check and test the attached file for more details.

    • DanielLeMay's avatar
      DanielLeMay
      Community Member

      Those triggers don't look complicated at all. I will remember them and might use them in the future for a project. Thanks for the demo file.

  • Button glitches happen. Sometimes, as Nedim​ pointed out, creating new ones fixes the glitch.

    I don't think variables are needed for tracking in this situation, though. When an object has a Selected state and a Visited state, a trigger will recognize it as Visited even though it will show as Selected when first clicked. (Yup. They made the program smart enough to know that an object that's been selected has also been visited. 🤣)

    • If the object isn't in a button set, it will toggle between Visited and Selected on subsequent clicks. 
    • If the object is in a button set, it will change to Visited when another object in the button set is Selected

     

    Here's more info about built-in states: PRIMER: Take advantage of built-in states | E-Learning Heroes 

  • DanielLeMay's avatar
    DanielLeMay
    Community Member

    I tend to get myself confused when I have too many triggers. I am sure I will get there, but not today. What I did was to keep the states and made all of my visited and selected states look the same. I like the look of it, and it works the way I want. I will continue to learn and experiment.