Forum Discussion

Re: Javascript events in Storyline

Hi Bart,

One way you can get Storyline to react to an event from JavaScript in a WebObject is to change a variable value in your Storyline file.

You could have a variable called "listener" (type text) in Storyline. You can then update the value of this variable from your WebObject:

// Get reference to storyline player
// using parent, as a WebObject is in an iframe
const player = parent.GetPlayer();
player.SetVar("listener", "dosomething");


Then in Storyline, you can set-up a trigger that reacts when the variable "listener" is changed, for example:

Jump to slide next slide
When the variable changes
listener

If listener = value "nextslide"

One thing to look out for though, is sending multiple "nextslide" values to the variable will not trigger a change, as it is the same value. You would always have to set your variable back to "(blank)" to ensure that each event, is a variable value change.

Will that help with your situation Bart?

No RepliesBe the first to reply