Forum Discussion

TH-bf52b1b3-f6f's avatar
TH-bf52b1b3-f6f
Community Member
1 day ago

Show Object on second visit/revisit

I simple want a text "page already visited" to appear at the second visit of a layer. But the text does not show up.

2 triggers:

First Trigger:
I set the status to "Normal" of the "page already visited"-textbox from status "invisible" on timelinestart of the layer IF variable Sites_Profil_ChangePassword is true.

Second Trigger:
I let the variable Sites_Profil_ChangePassword to switch to "Right" from initial "False" state when the timeline reaches 0,25 seconds of the layer.

The textbox is on top of all elements in the layer and always visible.

Layer Property is "Reset to initial state".

This setup is working in a new file and also within the same file with a new test layer. 

Any ideas?

As I can't create a new SL-file as there are weeks of work in it.

 

 

5 Replies

  • TH-bf52b1b3-f6f​: Here's a screenshot of your file, with a few highlights added:

    The special text on layer 1 has an Initial state of Hidden. The Slide Layer Properties are set to "Reset to initial state." So that text would be Hidden every time the layer reopens. However, because a "when timeline starts" trigger always reruns, that text will change to Normal when the layer reopens.

    The reason you don't see it if you jump to layer 2 and then jump back to layer 1 is that the "Hide other slide layers" option in not selected in either of the Slide Layer Properties. 

    That means that layer 1 never closes unless the user clicks the Hide this layer button. So in the "open layer 1, jump to layer 2, jump back to layer 1" situation, layer 1 never closes, which means it never reopens. Thus, the trigger to show the special text when the timeline starts never runs. 

    The simple solution: check the "Hide other slide layers" option.

     

    By the way, the solid background on your layers does prevent the user from seeing the base. However, that doesn't prevent the user from tabbing to the buttons on the button. So I suggest you also check "Prevent the user from clicking on the other layers" in the Slide Layer Properties.

  • ronald-hicks's avatar
    ronald-hicks
    Community Member

    Your pattern is sound — and the fact that it works in a test layer is the biggest clue. The triggers are right, so something else in that layer is interfering. Two places I'd check:

     

    1. The variable type. Open Manage Project Variables and confirm Sites_Profil_ChangePassword is a True/False variable, not text. If it's text, setting it to "Right" while checking "is true" will never match — both sides have to agree exactly.

     

    2. A conflicting trigger on that layer. Search the layer's trigger panel for anything else touching the textbox or the variable. Triggers run top to bottom, so a later "hide" trigger silently wins over your "show". A test layer has no competition; a layer with weeks of work behind it usually does.

     

    Layer reset doesn't touch variables, so the True value survives the revisit — that's why the pattern works in principle. My money is on #2.

    • TH-bf52b1b3-f6f's avatar
      TH-bf52b1b3-f6f
      Community Member

      Thanks, Ronald. Afters hours of testing it looks like a damaged file. See attached file.

      I reduced my original file to the core. If you switch between layers, the text won't appear. As soon as you hide the layer and revisit, the text is shown.

      Or do I miss anything?

      • ronald-hicks's avatar
        ronald-hicks
        Community Member

        Nice work isolating it to a repro file — that rules out half the suspects right there. And honestly, what you describe (fails when switching layers, works after hiding and revisiting) points me away from file damage and toward trigger timing. With "Reset to initial state," hiding and reshowing restarts the layer timeline, so your timeline-based state change fires again — this time with the variable already True. When you just switch layers, that timeline point already passed before the variable flipped, and nothing re-checks it afterward.

         

        So the fix: stop relying on the timeline to do the state change. Replace that trigger with "Change state of [textbox] to Normal when variable changes, if Sites_Profil_ChangePassword = True." Then it fires the instant the variable flips, wherever the timeline happens to be. One more thing to check while you're in there: make sure no other trigger sets that textbox back to Invisible on timeline start — that would produce exactly the same symptom.