8 Replies
Thor Melicher

Try using quotation marks to see if this fixes the problem:

var viewed = player.GetVar("Project.SlidesViewed");

Using quotation marks says to grab what it is called inside of Storyline and without quotation marks assumes it is a variable you want to pass in that you have defined in your JavaScript.

FYI - I'm using SL 3 so I'm not sure how the builtin variables are being shown now in 360 but if you can't get the variable as written try dropping the Project. to see if that works.

Hope that helps!

Paramjot Saini
Thor Melicher

Try using quotation marks to see if this fixes the problem:

var viewed = player.GetVar("Project.SlidesViewed");

Using quotation marks says to grab what it is called inside of Storyline and without quotation marks assumes it is a variable you want to pass in that you have defined in your JavaScript.

FYI - I'm using SL 3 so I'm not sure how the builtin variables are being shown now in 360 but if you can't get the variable as written try dropping the Project. to see if that works.

Hope that helps!

Hello Thor Melicher,

i am aware that quotation marks will convert the content available within to string, the problem i am referencing here is that i am not able to call getPlayer() function.

Error Detail:

user.js:2 Uncaught ReferenceError: getPlayer is not defined

i traversed around this community and found alot of solutions posted like:

1. use parent.getPlayer() instead of getPlayer(), in my case not working.

2. use timeout for few seconds, in my case not working

Paramjot Saini
Russell Killips

I don’t think project variables are accessible with JavaScript. Try creating your own variable and then assign the project variable to your created variable using a trigger. You should then be able to access your own variable using JavaScript.

i will give it a try.