Intermittent and infuriating problem with a URLLoader () script
Hi all
I posted a question that related to this problem a few weeks ago in the general forum, but I'm now almost certain that this is an actionscript issue.
I have a flash interface that I've built for a client that is a schematic of a factory and it displays various bits of data. It's extremely simple and involves calling a dynamically generated variable string from a php file and displaying the values. This is the actionscript that I'm using:
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function dataLoader():void {
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, loading);
loader.load(new URLRequest("http://www.mysite.com/myscript.php"));
function loading (event:Event):void {
flow_1.text = loader.data.flow_1;
flow_2.text = loader.data.flow_2;
flow_3.text = loader.data.flow_3;
}
}
dataLoader();
setInterval(dataLoader,30000);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
As you can see it's very simple. It runs the dataLoader() function as it loads and then uses setInterval to reload the data at intervals (this is necessary for the functionality of the interface).
The problem I'm getting is this:
- The interface works for me on all of my machines (3) on all of my browsers all of the time.
- For most of my clients it works only some of the time. Sometimes it will work on some browsers, sometimes on all browsers, sometimes it won't work at all on any browser. By 'won't work' I mean that the interface shows up but displays no data.
- I have deduced that this has nothing to do with the browser used per se, or the browser version or Flash player version. It happens across a range of all these, sometimes working, sometimes not working.
- It also isn't a font display problem. As I mentioned it does work and display data correctly, but only intermittently for some people.
It's infuriating because it's hard to debug. If I Teamviewer in to the client's machine and try to debug it and it starts working I may think that I've solved the problem, but each time I've done this it's just been a coincidence and the script has decided to work for an hour on that computer!!!
Any help with a solution or possible debugging strategy would be extremely welcome.
TIA
Chris