When do .txt files get loaded?

0 favourites
  • 5 posts
  • I'm having trouble in Chrome, where text files are gotten using AJAX, however, on the first time a text file is requested, I don't get anything from the file (no error either). If I wait (like 30 seconds) before initiating the JSON get, then it works. This is only in Chrome. This only happens the first time I open the game in Chrome once the browser was cleared. After that it always works.

  • Are you using AJAX to request files? Could you post a screenshot of your code?

  • Are you using AJAX to request files? Could you post a screenshot of your code?

    Yes, using AJAX (note that in my original post I accidently wrote JSON, which is incorrect).

    The thing is, in all browsers exept Chrome, the text file loads quickly. In Chrome (if the browser is cleared), the first text file requested takes a very long time to load (I have added a message to the user so they know something is loading - but it can take over 20 seconds). Note that the text file being loaded is about 1k, just a list of about 30 words. Once it's loaded, then all other text files will load at a normal speed. And if I close the game and reopen it, all text files load at a normal speed. It's just the very first file being requested at the very first time going in (in Chrome).

    I understand how audio files get loaded (sounds and music), but what about .TXT files?

  • From my experience even huge text files load from project files in milliseconds on all browsers. However if you are displaying that text in a text field then that takes forever to load into the field in chrome compared to other browsers.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • From my experience even huge text files load from project files in milliseconds on all browsers. However if you are displaying that text in a text field then that takes forever to load into the field in chrome compared to other browsers.

    Interesting. I'm actually loading it into a text object and then putting it into an array (I do this for all the words in the list until they're loaded). Maybe I should use a global variable instead. I'll try that and see what happens.

    Thanks

    Okay - I made the change but there's no difference.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)