Delaying actions on a trigger

Feb 21, 2013

Is it possible to set an action to delay by a given amount of time once a trigger has occurred?

On a slide I have various images the user click to reveal information. I have set a variable to track when they have seen them all, so that instruction text changes telling them to click Next to move on. The issue is that they are told to move on at the same time as the final set of information displays. I want the instruction text to change after a sufficient amount of time for them to read the information. 

I can achieve this by displaying the final instruction to click Next on a new layer (while allowing interaction with the base layer).

However, this workaround is not an option where the slide already has layers.

Any ideas?

18 Replies
Sam Carter

First, my solution would be to present both bits of instruction on screen and leave them there until the student leaves.  People read at different speeds don't they?

If you feel a timer is right, JavaScript is the only solution I know.  When the conditions are met to start a time, call a JavaScript which will tick away the time required, then set a variable to the value needed to trigger the on-screen prompt.

Would be nice for Storyline to do this without JavaScript.


Bryan Tregunna

Phil Mayor said:

I would have a hidden object (offslide if needed) that has a your delayed trigger on timeline end.  Set the length of the object on your timeline to the desired delay, 

 The set a trigger to change the state of the object to normal, when the object ends your delayed trigger will play

Thanks Phil, but... I have tried this before without success. I have an object which is hidden and this becomes Normal on trigger.  I have this object to display for 2 seconds, but it remains for the remainder of the slide.  

My assumption is that the timeline is only relevant to objects on Entry. What am I missing?

Sam Carter

function setTimer( seconds ) { // Set Storyline variable StoryFlag to 1 on five second timeout

  setTimeout( function() {GetPlayer().setVar("StoryFlag", 1)}, seconds);



Add a button or some event that executes the above JavaScript on your screen.  

Then, add the numeric variable StoryFlag to your course with a default value of 0. (Avoid boolean true/false, they're broken in Storyline HTML5).

Add a trigger to do what you want when StoryFlag has a value of 1.

Phil Mayor

Bryan Tregunna said:

Yeah but, no but, yeah but...adding a layer works fine when the action is on the base layer. But when the action is already on a layer, displaying a new layer won't keep the previous layer visible. 

Or is there a way to do this?


Alas, I fear that javascript may be the only way forward.

Click on the cog next to the layer you can choose to not hide all other slide layers, you can then have as many layers open as you want

Gillian Delvigne

Hi Sam,

I tried this method but it didn't work.

I wanted to diplay a layer after a x seconds delay when the learner clic on an element (click area here).

So I created a StoryFlag variable : number type and set on 0 by default.

I created a trigger who executes the above js code when clicking on the area.

I created another trigger who was supposed to show my layer when StoryFlag turn to 1.

No result after exporting my project for the web (HTML5).

Did you try to run your code in storyline with success?

Thanks for your reply.


Sam Carter

Haven't tried this but:

- Create a transparent layer with timeline of x seconds.  No audio, don't hide base layer, etc.

- Add a trigger at the end of the layer to show the desired layer.

- Be sure to set the transparent layer properties so the base layer timeline continues to play or pause as needed, also be careful to set the hide/don't hide other layers as needed.

Would like to know if this works. 

Julie Warwick

I'm having a similar issue - and Michael Hinze's solution is great. You can also keep the motion path on screen by creating a motion path on any object such that the motion path doesn't actually move the object (i.e.; the red and green stop and start circles are on top of each other). Then set the motion path duration to the number of seconds you want a delay. Then activate the motion (which is static) when the user clicks the button. Then start the next action trigger (your layer) based on when that motion path completes. Does that make sense?

This discussion is closed. You can start a new discussion or contact Articulate Support.