Skip to main content
dalvydasv27776233
Inspiring
February 21, 2019
Answered

URLLoader not working in good way when swf in server

  • February 21, 2019
  • 1 reply
  • 505 views

I use some URL loaders in my swf to get lines from txt file in server. BUT when I do tests on my compiuter it works fine, I had some isues before but now it works good. But when i upload swf in html in web browser I have some problems. FOR EXAMPLE: In TXT file i have lines for example: Hello Bye Hey Swf shows lines: Hello Bye Hey BUT if i change lines in TXT for example: Hello friend Bye my love Hey, how are you Swf shows lines: Hello Bye Hey WHY I SEE OLD LINES FROM TXT FILE> in every case I have new call to this URL loader but see old lines. Why this hapening? I use for these test string var textline = []; maby here is the problem? Sometimes swf uploading new (right) lines from txt files, when I try this other day 😄 Or after some time. Maby some ideas why this happening? All permisions for files in server is 777.

This topic has been closed for replies.
Correct answer kglad

you're loading a cached file.

append something to the file name to prevent that.  eg,

var urlReq:URLRequest('yourfile.txt?version='+Math.random());

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
February 21, 2019

you're loading a cached file.

append something to the file name to prevent that.  eg,

var urlReq:URLRequest('yourfile.txt?version='+Math.random());

dalvydasv27776233
Inspiring
February 22, 2019

Can you explain how it works?

kglad
Community Expert
Community Expert
February 22, 2019

your file name is changed each time it's loaded so it looks different and the cached version is not retrieved.

if you want more info, google "query string".