Forum Discussion

mamrich's avatar
mamrich
Community Member
2 months ago

Changing the state of an icon upon revisiting

Hello, 

I have an audio icon on all my slides and any accompanying layer. The icon's "normal" state is black, and its "playing" state is white. When the user clicks on the audio icon, it changes to white and plays the audio file. I have it set to toggle back and forth, playing and pausing the audio, and switching between black and white accordingly.

The challenge I'm facing is that my base layer properties are set to "resume saved state" when revisiting. This setting ensures that users who have already interacted with the slide do not have to wait again for the next button to be enabled. Because of this layer property, if the user leaves the slide while the audio is playing, then revisits that slide, the audio icon remains white (indicating the "playing" state) with no audio playing. I want the audio icon to always revert back to its "normal" state (black) upon revisiting the slide, but I haven't been able to resolve this.

I have attached my triggers on the base layer. 

Thank you! 

Melanie

  • Hi mamrich you should be able to just set a timeline starts trigger to set the audio icon to the desired state when the slide loads.

    If you have any further issues, you could always use a variable to determine whether the slide is complete too. For example, when all required conditions are met, a True/False variable called "slideX" (where X = the scene/slide number to make it unique) is set to True. Then when the user accesses the slide again, just check to see if "slideX" is equal to True and set the Next button to enabled if it is True, else, leave Disabled if still False.  Using this method, you can then set this slide to Reset to initial, but the variable will determine if the Next button is enabled.

    I use this method frequently, when I want the content on the slide to reset, but don't want to force the user to complete the same content again, allowing them to select Next and continue.

    • mamrich's avatar
      mamrich
      Community Member

      Thank you so much for your assistance!

      I added a trigger to reset the Audio Icon to its "normal" state (black) when the timeline starts on this slide. This worked if the user revisits the base layer. 

      Unfortunately, when the user plays the audio on the base layer, clicks to view one of the many layers attached, and returns to the base layer, the audio icon is in its "playing" state (white). 

      • SamHill's avatar
        SamHill
        Super Hero

        Hi mamrich you can continue to use the same trigger to set the audio play icon to the required state from any layers that you open. For example, if you open a new layer, add a timeline start trigger to the layer to set the state of the audio play button to the required state. When the layer is closed, the audio icon will be in the state you set it to.