Forum Discussion

BarbHall's avatar
BarbHall
Community Member
3 months ago

Adding a trigger to a state while in the same state

HI everyone,

Can I add a trigger to a state while I'm editing it?

I know I can control states when outside of them, but what I'm trying to do is after the audio file that I've included in a selected state has completed, I want to set a variable to true. 

There are four occurrences, and 4 variables, each playing their own audio file in the selected state. I've renamed the audio file in each selected state, but how to do I reference it? It's not on the timeline, and editing the trigger isn't available.  I want to play a short media file when all four audio files in each of the selected states has played to the end.

I'm doing this so that the "Please click exit..."(text to speech 2) audio doesn't play over any of the audio files in the selected states. I only want it to play after all four audio files in the selected states have completed.  The way it works now is I've paused the please click exit audio when the time line starts, and the true false buttons are only set to true if the user clicks the button, but not if the audio is finished.

I've attached the slide below.

Any ideas?

Thanks in advance,

Barb

2 Replies

  • Not good practice to put audio in the states

    Put all the audio on layers and just show the layers gives you much more control

    The for the extra audio put it on a layer and add triggers to the audio on each layer to show the extra layer when media completes if all your buttons are visited, doesnt need variables or putting audio in states.

  • Although I agree with Phil about this use of states, and feel that states in general tend to be a bit iffy, I understand that sometimes you really just need an answer to the question. Putting a bunch of objects and triggers on states makes then difficult to understand, edit, and maintain. It's generally better to make states more visual and trigger actions separately, and externally.

    That said, if you really need to edit a state as you describe then try this:

    • Save a backup of your project just in case
    • Make a new empty layer on your base slide
    • Return to the base slide layer
    • Select the object you're interested in
    • Switch to the Sate tab in the timeline
    • Click Edit State
    • Go to the state in which you wish to add a trigger (click on it to select)
    • Click in the main slide window
    • Type CTRL-A to select all objects within your state
    • Type CTRL-X to cut the objects out of the state
    • Click Done Editing in the State tab
    • Return to the Timeline view
    • Click on the new blank base slide layer you created in step 1
    • Click somewhere in the main slide window
    • Type CTRL-SHIFT-D to duplicate all of the objects you cut out, in their original positions
    • Do whatever editing you want (including adding triggers)
    • When finished, reverse the above steps. In other words: 
    • In the layer, select the main slide window, CTRL-A, CTRL-X
    • Return to base slide, select the original slide object, go to State tab
    • Edit State, select the now empty state you wanted to edit
    • Click in main slide window, CTRL-SHIFT-D, click Done Editing State

    Your state should now show as it was (or however you changed it), with any added triggers visible. Make sure to test the functionality to ensure nothing broke during the transfer process.

    I tried it with your slide, adding a variable change trigger on media complete (within the state) and a text box displaying the T/F variable value on the base layer to test it. When the media on the state completed, the variable changed as expected.

    If you need to make complex states for some reason, it is often easier to manage if you do it outside of the states, and then paste it as a whole into your state when it's ready.