Passing values from external file

Oct 31, 2018

Hi,

I work on SL3 and I'd like to know if it is possible to create variables in an SL3 project and load their values from an external txt file?

Thanks ;)

7 Replies
Russell Killips

Hello Serge,

I use an xml document to load external values into a project. The xml document can be created/edited using a text editor like notepad.

For example, I have a file called values.xml and I place this file in the root of the published output. Inside the file, it has:

<?xml version="1.0" encoding="utf-8"?>
<store>
<db value="This is value 1"></db>
<db value="This is value 2"></db>
<db value="This is value 3"></db>
</store>

Then using a javascript trigger, I get these values from the xml document.

I have attached a sample xml document and a storyline project for you to take a look at.

Browser security usually blocks local reading of xml documents, so you will need to upload it to see it work.

Serge Benamram

Thanks a lot! The principle is exactly what I need but unfortunately I can't open your SL file (a warning is displayed, "this project uses functionalities not available in this SL version ..."), I don't understand, my update from SL2 to SL3 is very recent ... Does your files comes from SL360? Maybe it's the reason, I don't know ... Can you tell me ?

Thanks

Serge

Serge Benamram

Hi Daniel,

I've tried and it's OK with the last SL3 update, the projet is displayed in HTML5 but the values are not loaded ... I have put the XML file in the same folder just near the story_html5.html file. Have I something to do more please???
Your name seems to be french, no? I am french and in Paris ;) so if this discussion can be continued in french it would be so well ! En bref, ce serait top! ;))) 

This discussion is closed. You can start a new discussion or contact Articulate Support.