is Javascript no longer to access (set or get) player's variable?

Nov 10, 2023

I'm using storyline v3.8 pretty latest. I saw a lot of forums and videos where people easily access user's variables (that we set in triggers) while for me it doesn't work at all and it always gives back "null". Is it something that storyline intentionally discontinued or am I missing something.

I've two examples:

I set a variable "userEmail" in a trigger and it is accessible on other slides through triggers. But I'm trying to use this variable in Execute Javascript and there I always get "null". Here's what I'm doing:

var player = GetPlayer();

var userEmail = player.GetVar("userEmail");

alert(userEmail); // always null

Also in another example I try to set a variable in player and right away access it in next line and it is still "null"

var player = GetPlayer();

player.SetVar("userEmail", "test@gmail.com");
var userEmail = player.GetVar("userEmail");

alert(userEmail); // always null

5 Replies
Walt Hamilton

It is not happening because you have the trial version. The trial version IS the paid version, except after the trial time, it will stop running. 

If the alert dialog shows, and the variable is null, you need to check SL and make sure it is working. If the dialog doesn’t show, the problem is the JS.