So yesterday at the ol-l-l-l-l-l-l-l-l J.O.B., I was trying to get a little Flash app I made to read data from XML output on a particular server. That server is one that the company I work for owns, so I just knew that it would work fine. After I completed the apps, I tested them on my local and they worked like clockwork…They read the data, displayed the results, just like I planned on. Then I uploaded everything to one of my personal servers just to check that they would work online. And of course, NADA.
And I’m not talking about “nada pequito” or however it’s spelled. I’m talking about “NADA TODOS”. (If that isn’t the best butchering of the Spanish language, I just don’t know what is).
So I of course rechecked everything, uploaded the Flash files again, republished the Flash files in different versions, and tried again to no avail. I rewrote the HTML page that was using the Flash files, changing and editing all the different parameters used to pass values to the Flash. I just did everything I could think of.
I then proceeded to bang my head on my cubicle desk for the next 3 or 4 hours.
After my head went numb, I did what every good programmer would do…I went to Wendy’s for an hour. And while at Wendy’s I had an epiphany. I had faintly remembered seeing something called “crossdomain.xml” in another FLA file sometime before. I don’t why that thought suddenly popped up, but I felt pretty confident that my answers lied within this mysterious file.
So when I got back, the first thing I did was read up on this file, and sure enough that’s what the problem was. Check out this excerpt from the adobe website…
” For example, a Flash movie loaded from http://www.yourserver.com/flashmovie.swf can access data residing at http://www.yourserver.com/data.txt. The text file is located within the same domain as the SWF.
However, an attempt to load data from http://www.NotMyServer.com/data.txt will fail and no error messages are displayed. The load action will cause a warning dialog to appear.”
D’oheth. This is exactly what I was trying to do. I had put the Flash file on my personal server, but was trying to read data off the company server! So after I made a crossdomain.xml file and got it on the company server, everything worked out. It’s so funny that as a programmer, everything can seem so simple until suddenly nothing works, and then as quickly as the problem surfaced, it can be resolved in about the same time frame despite all the hours in the middle of seemingly unending attempts at any and all possible fixes. Ha ha. (Needless to say, after I got this working, I got the hell outta work).