Skip to main content
jem104
Participant
March 30, 2020
Question

Branching and "played once" audio advanced action (Captivate 2019)

  • March 30, 2020
  • 1 reply
  • 421 views

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!

    This topic has been closed for replies.

    1 reply

    Lilybiri
    Legend
    March 30, 2020

    You will need two Boolean variables, one for each branch. It looks like you are using the same variable for both.

     

    jem104
    jem104Author
    Participant
    March 30, 2020

    So sorry to ask.

     

    Boolean variable....so would that be the _played once? 

    or the numbers "0" and "1"  ?

     

    sorry. 

    Lilybiri
    Legend
    March 30, 2020

    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