Copy link to clipboard
Copied
Hi,
I have two branching sections in my captivate 2019 project in which I want to use a "played once" script. The first one works well:
_played is equal to 0,
play audio (file inserted)
assigned played with 1
When I go to the second branched menu, I try to use the same script with a different auido file. However, it never plays the audio.
Do I need to change the script? If so, how?
Ideas?
Thanks!
Copy link to clipboard
Copied
You will need two Boolean variables, one for each branch. It looks like you are using the same variable for both.
Copy link to clipboard
Copied
So sorry to ask.
Boolean variable....so would that be the _played once?
or the numbers "0" and "1" ?
sorry.
Copy link to clipboard
Copied
Where did you get that action without understanding it?
A Boolean has two values, which can be 0/1 or False/True or No/Yes.... doesn"t matter.
Normall I indicate that an item is a varialbe by puttin v_ before its name. You unique variable is _played. It sdefault value is set to 0, which means that the audio clip has not yet been played. The event triggering the action for the first time (what you call a 'script' which is a conditional advanced action) will not only play that clip but also toggle the variablee to 1. Correct action would look like this:
But if you have only one Boolean variable for both branches, you'll have to re-assign the value 0 to that variable. You can do that using the On Enter event of the first slide of the second branch.
However since you seem pretty new to actions, easier way is to create TWO variables, one for each branch: v_played1 and v_played2. Then create a duplicate action for the second branch, where you replace the first variable name by the second one.
BTW: descirbed a solution to have the same happening for slide audio, but that will be too complicated I fear.
http://blog.lilybiri.com/play-audio-once-on-first-visit
Copy link to clipboard
Copied
Ah.
I undestand the concepts of the true/false. I did not understand the term, "boolean" well enough to apply it.
A programmer I am not, but I can learn.
Thanks for your help.