I am new to Lectora, and I am not all that great with variables. I thought that I had understood variable management and how to trigger an object to show, but it did not result in success after a lot of troubleshooting.
Let’s say you have a page that has an inherited (from title) hidden object. Also on this page, you have three audio clips. One audio clip that plays on launch of the page and two others that are triggered by clicking two buttons.
If I wanted to only show the hidden object only after all three audio clips done playing play, how would I go about this?
What I attempted did not work. What I did try was:
I created three variables to correspond with the three audio clips. Variable Audio 1 = Value of 0 Variable Audio 2 = Value of 0 Variable Audio 3 = Value of 0
Object inherited to page that I want to display after three audio clips are done playing = initially hidden Audio Clip 1= Action: On Done Playing then Modify Variable Audio 1 – equal to = 1
Audio Clip 2= Action: On Done Playing then Modify Variable Audio 2 – equal to = 1
Audio Clip 3= Action: On Done Playing then Modify Variable Audio 3 – equal to = 1
Finally, action I set to the is set to make the object display on the page only after all three variables are set to 1… so…
Page with all audio and inherited object on it –
On Show – Do Nothing, if conditions set to Variable Audio 1 Equal to 1, Variable Audio 2 Equal to 1, and Variable Audio 3 Equal to 1 then show object that is initially hidden.
I don’t know if I’m totally just not understanding the fundamentals of how variables work, but I thought this would do the trick… I apologize if I’m just a babbling idiot.
Any thoughts of an easier solution or how I may have tripped up??
I don’t think you can have an action doing nothing, it should either throw an error or it won’t be added to the page at all. An On: Show action on page level is run once when the page is loaded, so it cannot be used to do something on the page later on. It can be used to show the object when a user returns to the page.
Your conditions and use of the variables should be correct, you just need another trigger. Add a second action to each of your audios
On: Done Playing
Target: Your object
… and use the same conditions (if “audio1 = 1 AND …)
I agree with Tim’s solution as the preferred. If you wanted to keep everything as you have it, then instead of having the action on the page: on ‘show’, ‘show’ object, (with conditions) you would need to change to:
on ‘timed interval’, ‘show’ object, (with conditions).