Hi All,
I would really appreciate anyone’s help with the following as I’m struggling to know if it can be done easily and how to go about it. I’m trying to create a chapters already read logger within my project.
I have an external file in Hype resources folder “readlog.js”
contents are this:
ReadLog = {
Book: 'Chap1'
}
Within my Hype project I have an onSceneLoad function:
const getData = document.querySelector('.JSData--read');
getData.innerHTML = ReadLog.Book ;
I am able to read the values of “Book” as (“Chap1”) into a .innerHTML text field within my project.
But what I would also like to do is to update/change the values of “Book” in the “readlog.js” file.
I’m assuming that because the .js file is within the hype environment at runtime it can still be edited dynamically.
Also because I have a lot of chapters to log, I would prefer to edit a saved file within resources.
If anyone can provide an example file of writing to a .js file that would be really helpful.
If it cannot be done, what would be the best solution? local.storage or writing to .txt file or other?
Thanks
Mrk