Client input needed


(Bob) #1

Hi
I have a client who is very impressed with the Hype Sample I have created but asks if he can update text on the presentation easily and also change a URL, so I am asking you …

1 Can I refrence a txt file in the Resourses which he can change at will
2 Can I also refrence a txt file that contains a URL which will be active in the presentation

and how do I do these things

I hope this makes sense??

Presentation will be on a local computer not on net

Thanks
Bob


(Mark Hunte) #2

There are a few ways,

Have a look at these

https://forums.tumult.com/search?q=external%20text


(Bob) #3

Thanks Mark thats great stuff I’m really enjoying Hype takes me back to the good old days of Director.

Next question:
All on local server.
Can a user enter text into a text box and then that text be written to a txt file on resourse folder ?

Thanks

Bob


(Mark Hunte) #4

You would need to google for the best solution for you setup if indeed you are using a local web server.

If you mean local network volume. Then normally no.
You can write to file by using something like this. ( picking up the text from the form first.

But that will go to the downloads folder.

There are ways that you can also talk to the system via apps/script/browsers but that is involved and a security risk.


It may be possible to use google Extension Options , I have used this for preferences for a Chrome Extension, which gets sync to the users account. But again involved and you probably would need to build an extension.

And this is only for Chrome


Your best bet is to have the user input stored on localStorage.


(Bob) #5

Hi Mark
I’ve come up with a bit of a problem
I have managed to place the contents of a txt file into the inner HTML of text boxes
this is the code

var txtFile = new XMLHttpRequest();
txtFile.open(“GET”, “${resourcesFolderName}/text.txt”, true);
txtFile.onreadystatechange = function() {
if (txtFile.readyState === 4) { // Makes sure the document is ready to parse.
if (txtFile.status === 200) { // Makes sure it’s found the file.
allText = txtFile.responseText;
//lines = txtFile.responseText.split("\n"); // Will separate each line into an array
var customTextElement = document.getElementById(‘textHolder1’);
customTextElement.innerHTML = txtFile.responseText;
}
}
}
txtFile.send(null);

this works fine until I try to access the html file over our network as this is what my client wants to do
It will work fine in Firefox but not in Safari and chrome and IE

Any ideas

you can see a working example at http://newps.nps-develop.co.uk/GSK_demo.html
if you click the left green icon a box should appear with text and a picture the text is referenced by the .txt file
this is what is not showing in Safari

Please tell me what I’ve done wrong…

Cheers

Bob


(Mark Hunte) #6

The problem you are probably running into is cross domain security.

A simple trick is to just use a .js file instead of a .txt file

The client will need to understand that the need to write between quotes and make sure that the var/ global stays the same

textFile_js.hype.zip (13.2 KB)