Using Javascript to trigger event in Storyline
Nov 19, 2014
I'm using Storyline as a decsision tree for agents and its embedded multiple places in the agent-only knowledgebase.
There are actually multiple decsion trees for different situations in this one published file. There is currently a main menu where agents can click to get to the one they want.
So, here is my question. I want storyline to automatically advance to a particular screen depending on the article that it is loaded from.
Each article has a unique identifier "gen number" so theoretically, Java script could be run when the decision tree is loaded. If a particular gen is identified, a trigger could be set to make it load to a particlar screen.
I had my friend write up the javascript which would return a True value if it was loaded from a particular article. Assuming this code is correct, my next step would have to be setting it up in Storyline so a trigger would occur and load a particular screen.
Hope that makes sense. Here is the code:
if ("tabGEN85157" == document.getElementsByClassName("TabClassActive")[0].id) { return true; }
So, I know I can enter this a trigger when main screen loads, but then what do I do?
1 Reply
Hi Ben,
When complex branching is present, I usually set up a "router" slide containing the triggers pointing to these pages, followed by a listener trigger (something like "go to layer check when variable x changes). That way, I am able to keep all navigation triggers in one place.
Hope this helps,
Alex
This discussion is closed. You can start a new discussion or contact Articulate Support.