Forum Discussion
Link to a URL held in a variable
I understand that this is a very old thread and I am not sure if Martin or Kamil see this post. But I thought they might be still around or one of the heroes could help on this.
I am trying to do the same thing that Martin was going to do: store URLs as variables in a .js file and import them to Storyline. I have created an Execute JavaScript trigger, like Martin's:
var player = GetPlayer();
var url = player.GetVar("Lecture1");
var win = window.open(url);
In the LinksList.js file, I have defined Lecture 1 as a variable:
var Lecture1 = "http://www.google.co.uk/"; // For simplicity.
I have put LinksList.js in the story_content folder of the published story. I have also modified story.html file as described at https://articulate.com/support/article/javascript-best-practices-and-examples-sl2, by adding this line between <head> and </head>:
<script LANGUAGE="JavaScript1.2" SRC="story_content/LinksList.js" TYPE="text/javascript"></script>
When I click on the link to the above trigger, it goes to a Storyline output/null page with a 'Your file couldn't be accessed' message.
Any help will be appreciated.
Related Content
- 12 months ago
- 12 months ago
- 12 months ago
- 12 months ago
- 12 months ago