Javascript in SL2 VS SL360


I have a question..

A year ago we made a course with a 360 degree photo with interactions in SL2. The 360 degree photo's got a hotspot with a javascript:

javascript:parent.player.SetVar(‘slideTrigger1’,Math.floor((Math.random() * 100000) + 1))

The variable would change and then it goes to the next slide. Pretty cool, we thought.

Now we have upgraded to SL360 and want to use this 360 degree photo with interaction again, but somehow it doesn't work..

Is there something changed in the upgrade? And how can we make it work in SL360? :D

4 Replies
Ashley Terwilliger-Pollard


Thanks for reaching out here. With Storyline 3 and 360, we changed our publishing engine to allow us to publish HTML5 first and only. Some of those changes also modified how custom Javascript connected to the player worked. It's something that our team is taking a look at how to allow access to those variables in the future, but in the meantime we'll have to rely on the communities expertise for steps around that behavior.

Let us know if you need anything else! 

Media Innowijs

Hi Micheal,

That is the whole javascript code.
We used Pano2VR to make the 360 photo interactive. In this file we made hotspots with the javascript code. javascript:parent.player.SetVar(‘slideTrigger1’,Math.floor((Math.random() * 100000) + 1))
Then we export this project into a html5 output.

In storyline we made number variables that has the same name as in the javascript code, that communicates with each other. And there's a trigger Execute Javascript var player = parent.GetPlayer();
We import the Pano2VR as a webobject in the slide and then it's done.

I can't attache a project because we only got photos of clients, so.. I hope I explained it clear, otherwise let me know :D