inserting web objects dynamically
Nov 02, 2017
By
Chris Pim
Does anyone know if you could add a webobject to a slide that has a dynamic url. In other words that would be different each time depending on a variable. So could I create a variable that is created at run-time that is fed into the url of the web object?
I see the url to the webobject is hard coded in javascript to a file...in my project example it is found here... html5 >> data >> js >> 6qurmYcWU9l
Something like this:
"objects":[{"kind":"webobject","url":"http://www3.hants.gov.uk/emtas-logo.png","html5Url":"http://www3.hants.gov.uk/emtas-logo.png",
Could that hard coded url reference be a text variable that equates to that same url?
2 Replies
The published javascript could leverage the Player.GetVar("<variablename>") to dynamically provide the url with two notes:
1. The javascript files are probably regenerated each time the project is published thereby erasing your modifications
2. Javascript doesn't work on mobile, or local playback (browser security restriction)
3. Publishing to HTML5 and Flash produces different javascript
Thanks Matthew that's very helpful.
This discussion is closed. You can start a new discussion or contact Articulate Support.