Forum Discussion

LisaMolina's avatar
LisaMolina
Community Member
2 years ago

Using true/false variables to show or not show layer

Hi, I could use some help. I have a slide where the user completes a drag and drop activity. When it has been successfully completed, a "congratulations" layer appears, and then the user navigates to the next slide.

On the next slide, the user has the option of navigating back to the previous slide. However, if the user does this, I don't want the "congratulations" layer to appear. I only want the base layer.

I tried creating a true/false variable that gets set to "true" once the timeline starts on the "congratulations" layer, and then I set the trigger on the base layer to only show the congratulations layer if the value is false, but no dice.

What am I missing? Attaching the file here. 

  • You don't need the variable. Before the trigger to jump to the next slide, put a trigger to close the layer. Use the same “when” as the "Jump to" trigger.

    • LisaMolina's avatar
      LisaMolina
      Community Member

      Thanks for the suggestion, Walt! I think I tried what you are suggesting, but it's still not functioning the way I want it to. Returning to the slide from the next slide still triggers the layer to appear. I only want the layer to appear the first time the slide is visited, but not on any future visits.

  • >Returning to the slide from the next slide still triggers the layer to appear.

    this is because of the Slide Property "When revisited -> Automatically decide"

    you need one extra trigger on the "Correct Layer"

     

    • LisaMolina's avatar
      LisaMolina
      Community Member

      Brilliant! This seems to have done the trick, thank you Jurgen!

      I did need to make one small adjustment and have the variable value set to true when the timeline of the layer reached 0.1 seconds as opposed to when the timeline started. For some reason, setting it as when timeline starts caused the layer to not show up at all.

      Thanks again!