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
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.
Sam
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 Sam, I feared as much.
I have no experience of Java, so I shall leave well alone!
And I have no option but to leave both on screen, but I am uncomfortable with this as this is inconsistent with the rest of the program. Standards, standards, standards.
Phil's solution looks promising and doesn't require programming.
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?
Bryan you are correct that does not work(I expected it to).The other option then is to show a layer that has a short timeline and then change a state or show a layer when the timeline ends of that layer, this one will work :-)
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.
function setTimer( seconds ) { // Set Storyline variable StoryFlag to 1 on five second timeout
setTimeout( function() {GetPlayer().setVar("StoryFlag", 1)}, seconds);
}
setTimer(5);
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.
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
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.
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.
You could also use an offstage object with a motion path of a certain duration. Then revise your trigger(s) to execute When animation xyz completes.
Super helpful, thanks! I'm using that method now.
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 post was removed by the author
Glad this also helped you out, Julie! That makes sense reading it, but sometimes I need to see those things in action to truly allow my brain to process how it's working. If you need help or get stuck, just share a copy of your .story file here in ELH and we'll be happy to look.
I made this example when I am applying the same tips.
A 'delayer' can be put anywhere or outside the canvas.
Very helpful and easy solution! Thank you!
Just chiming in to say thank you Julie Warwick and Michael Hinze - this is such a helpful trick. I do wish Articulate had a simple "delay action" feature, like Lectora does, but this will do in the meantime. Thanks.
This discussion is closed. You can start a new discussion or contact Articulate Support.