WebObject to change a variable in Storyline 360

Oct 06, 2022

Hi there

I hope some JavaScript wizards can help me with this one!

I have managed to put together a calendar picker plugin and import it into storyline using the Web Object function. 

I managed to get the calendar to create the variable "fclickedDate" and report it to the console using the window.console.log(fclickedDate) command in the object. 

Now to get it to feed that variable to Storyline...... 

I tried using  parent.GetPlayer()  and SetVer("selected_date", fclickedDate) functions in the function but I keep getting an DOM Exception error on the GetPlayer().  PLEASE HELP!

I have zipped the SL file along with a published file and the storyline file. hopefully someone can make some sense of this!

Many thanks

Carrie   

 

8 Replies
Jürgen Schoenemeyer

there is no DOM error

simple type error: selected_date (web object) <-> date_select (storyline file)

result with changed storyline file:

https://360.articulate.com/review/content/43e3a2e5-b884-4c89-904c-5618cb9f1ca6/review

Important for debugging web object:
you have to reimport the web object after every change (there is no auto update)

Jürgen Schoenemeyer

tested on review 360
 - Firefox 106 ok (Windows 7, Windows 10)
 - Chrome 106 ok (Windows 7, Windows 10)
 - Edge 106 ok (Windows 7, Windows 10)


I have nothing changed in your index.html

to check which version is included, publish to web your .story file from your uploaded zip

 

 

 

Carrie Wernham

Thanks everyone
I discovered the WebObject not updating when looking at the coding in the published file.  So I have been fiddling with the code of the index.html file on the fly  to try and get it to work with the debugger in Edge.

It still doesn't work (I get that "DOMException: Blocked a frame with origin "null" from accessing a cross-origin frame" error) when I publish the file to my PC but when I publish it online it works perfectly.  There seems to be some security hitch somewhere  maybe blocking natively installed files interacting? Or maybe I am launching the course from the wrong file?  

No matter though, as long as it works in 360Review and in my LMS when I publish it in my course, that's all that matters!

Thank you so much for your input.  I am very shaky on all this JavaScript stuff.  I have all these wonderful ideas to make my courses more engaging and realistic (I mostly make software simulation for my training). If I could utilise JS more to make it feel like the actual system the better.  Also importing tones of images and shapes in SL bloats the course size and issues with the course loading with our less than perfect network speeds. Screen recordings only get you so far.