This content has been marked as final. Show 5 replies
Are you testing this locally? If so, it won't work, because your system will look for a file that has the exact name, including all after the ?, and won't find it. However, a decent webserver handles filenames in a different way, ignoring the ? stuff when searching for the file. For local tests, just comment out the cache killer part.
If this happens when testing online, the webserver you use is misconfigured, I'd guess. In that case you must tell it to treat names with a ? so that it ignores the ? part when looking for the file.
Crazy that great minds must be thinking alike. I just ran into this very problem late on Saturday night. And I hadn't had a chance to work out the details. Thanks for the help.
This should work.
myXML.load("myxml.xml" + (_url.indexOf("file") == 0 ? "" :
"?timestamp="+escape(new Date().toString()) ) );
"abeall" <email@example.com> wrote in message
> I've long known the old timestamp query string trick for anti caching, but
> never really had to worry about with XML.load in Flash. I just now tried
> myXML.load("myxml.xml?timestamp="+escape(new Date().toString()));
> And it gives an error: failed to load file. If I remove the timestamp, it
> works. In other words, the ?timestamp= makes Flash think the file doesn't
> exist. I did some googling and found dozens of answers to "how to stop
> of XML" and they all said to use the query trick; however I am
> that a query string throws off the XML file name. Anybody know about this?
> Are you testing this locally?
Right on, blemmo. I was testing locally. Problem solved.
In addition to working on a webserver, it appears to work in locally if viewed in a browser, just not in the SAPlayer.
> (_url.indexOf("file") == 0 ? "" :