Skip to main content
Known Participant
Oct 15, 2021 2:39 PM UTC
Answered

Shared actions with conditionals

Hello everyone!

I have this project with 10 slides and I want to use a Shared Action. Each slide is a cutomized question where the user plays an audio twice. I have managed to create the advanced action for the first slide, as follows:

_var_audio= with default value of 2;

Then, the condition

If _var_audio==1;

play = selected audio

Decrement  _var_audio by 1;

disable = selected button (there is one play button on each slide; each with a different name).

hide = selected button

 

Else

Play = selected audio

Decrement  _var_audio by 1

 

1. On the second slide, I tried to reset the variable _var_audio on an enter slide by incrementing it to 2 (didn't work).

2. Should I create a variable for each audio on each slide?

 

Any suggestions?

 

Thanks in advance.

 

 

 

 

    This topic is closed to new replies. Start a new post to keep the conversation going.
    Lilybiri
    LilybiriCorrect answer
    Legend
    Oct 15, 2021 3:24 PM UTC

    Did you use this action as shared action or as advanced action? 

    For a shared action I would use these parameters:

    1. The button, which needs to be different on each slide since it needs to play a different audio clip
    2. The audio clip

    The variable v_audio doesn't need to be a parameter, but needs to be reset On Enter for each slide to the default value of 2.

     

    Debugging: on the first slide insert the variable v_audio (sorry for not using your longer name) in a text container. Time that text container for the rest of the project, always on top. Now you can check if the variables acts as expected.

    5 replies

    Lilybiri
    Legend
    Oct 15, 2021 2:51 PM UTC

    There is no reason whatsoever why you cannot reuse that variable by resetting it with the On Enter action of each slide. 

    I use shared actions all the time because for each advanced action I reflect whether a shared action wouldn't be possible.  Can you give some more details about the error you experienced? What is your debug workflow?

    Translate
    grcutzAuthor
    Known Participant
    Oct 15, 2021 3:18 PM UTC

    Thanks fro replying Lilybiri:

    When I preview the entire project (10 slides), the first slide works fine. After the second click on the play button, it disables and hides the button . When I click go to next slide, it also works fine. However, from slide 2 on, the play button on each slide keeps playing the audio more than twice and it doesn't disable or hide it. No error message is generated on the preview. Is there a specific way to debug the project while previewing it? 

     

    Sincerely,

     

    Translate
    Lilybiri
    LilybiriCorrect answer
    Legend
    Oct 15, 2021 3:24 PM UTC

    Did you use this action as shared action or as advanced action? 

    For a shared action I would use these parameters:

    1. The button, which needs to be different on each slide since it needs to play a different audio clip
    2. The audio clip

    The variable v_audio doesn't need to be a parameter, but needs to be reset On Enter for each slide to the default value of 2.

     

    Debugging: on the first slide insert the variable v_audio (sorry for not using your longer name) in a text container. Time that text container for the rest of the project, always on top. Now you can check if the variables acts as expected.

    Translate