Forum Discussion
GaryKenyon
9 years agoCommunity Member
SL3 Javascript GetPlayer() function not defined in HTML5 output
Hi forum.
I created a game a while back for SL2, my external JS file gets and sets a bunch of Storyline variables using GetPlayer, SetVar and GetVar.
With the release of SL3, I have published th...
MatthewSchmidt
8 years agoCommunity Member
I've been working on this problem for most of my day today, and thought I'd share my findings.
I have ran a number of unit tests and can confirm that the problem of running a script that calls GetPlayer() from a Storyline object contained in an iframe is 100% reproducible. This use case always results in the following error:
GetPlayer is not a function
Conversely, when the Storyline object is loaded normally via the story.html file, the GetPlayer() function functions as outlined in the JavaScript best practices documentation.
I have tested this with four different Storyline projects.
Is there any indication of when there might be a resolution to this problem?
MichaelAnder569
8 years agoCommunity Member
Have you tried referencing the parent with GetPlayer like this:
var SLplayer = parent.GetPlayer();
Related Content
- 6 months ago