To XML, or not to XML

That is the question. I was recently making a screen saver with Flash animation that draws figures. It was drawing these figures based on a set of quadratic curves and coordinates. Each drawing consisted of hundreds of these curves and coordinates and since we planned on making numerous drawings, it seemed like the sensible approach was to import these coordinates with XML and a little Flash programming. Then we could just have one flash file and several XML files and be organized. When it was tested locally, it worked like a charm and looked great. So we made it into an installable screen saver.

You would think we are done then, right? Wrong. Upon installing and testing the screen saver on many people’s computers we found that the whole flash swf executed much more slowly than when tested locally. The drawings were noticeably lagging and it was altering the timing of some effects. The fix was embedding the XML into the Actionscript code itself. Now we would have several flash files and would need to republish if there were changes, but it isn’t a big deal since nothing will be changing once it’s finalized. I am not completely sure why it worked quickly when tested locally, but not in the screen saver application. Either way though, eliminating the whole loading data portion of the project made it faster. It did need a lot of data at a fast speed. Don’t think XML is evil or anything. It is still completely useful and it is a giant time saver for applications that are frequently updated.

Now at least everyone can enjoy the custom animations without lag. It’s still my screen saver here and probably will be until I would have to make another.