Posted by andrei9992000 in SWF Studio V3 on May 21 2008, 11:35 am

Hi,

I have an XML file that is loaded off a server every minute. Based on one attribute, it should display a different message. (whether that attribute is 1 or 0). The XML file can be changed by a text editor like notepad whenever a user decides to do so.

When i test the functionality from Flash (whether I publish as a swf or .exe projector) it works fine. If the file is changed while the SWF is playing, the next minute it queries the XML it changes message. However, if I use SWF Studio and build the .exe file, it will only load the XML once, and every minute display the same message, even if the XML file was changed and saved externally.

Any ideas why this is happening?

Thanks,

Andrei


Posted by mbd in SWF Studio V3 on May 21 2008, 02:42 pm

The ActiveX Flash player is caching the XML. SWF Studio uses the ActiveX Flash player - the same one that IE uses. You would see this in a browser as well, not just IE.

You need to use a "cache busting" technique or use the HTTP plugin, which never caches. A simple technique is to add a querystring to the end of the URL so it won't be cached. This works for me:

var path = "http://[domain].com/file.xml?id="+Number(new Date());

Some techniques use a random number or a mix of a random number and the date.

The HTTP plugin doesn't cache data but it does add a lot more code to your project. You could create a class to handle that so it's a simple call and callback (just like XML.load and XML.onLoad).