Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
How can I load String arrays from the .txt file with AJAX? i've read a tutorial about Ajax but that tutorial only allow us to return one sentence.
I am trying to make every words in the sentence dynamic, that means i can change the words in the .txt easily to make new sentence.
How do you wish to store your "String arrays" in the txt file ? as JSON ? 1 string per line ? with a separator like ";" or "," ?
Here is a simple capx I made for loading N words from a txt file during runtime. You can store the words as you prefer in the for loop.
Hope this helps !
Develop games in your browser. Powerful, performant & highly capable.
Oh my god thats exactly what i want by separating the text in the .txt file, learned new stuff today. Thanks Guizmus! <img src="smileys/smiley1.gif" border="0" align="middle" />
No problem ;) If you need the "," for anything else, you can change it in the file with a ";", or any other separator, and change it in the events too (in the tokenAt function and tokenCount)
Understood! thanks (: