inserting web objects dynamically

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?

4 Replies
Brian Dennis

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

 

Matthew Bibby

I think this should be possible... but I wouldn't mess with the web object itself. Instead, I'd create an HTML page that would show the URL when loaded by the web object.

Where do these URLs come from? Do you have a list of them? Are they taken from Storyline variables?

And regarding Brian's points above:

2. Javascript doesn't work on mobile, or local playback (browser security restriction)

JavaScript does work on mobiles, but not in the Articulate Mobile Player. If you need to test JavaScript locally, just publish to HTML5 rather than Flash and most JavaScript should work okay.