Friday, October 29, 2010

flash.net.FileReference (Action Script 3.x)

I recently had the chance to work in Action Script at my job. I had not worked in Action Script previously but was encouraged as the language is a mix of JavaScript and C#/Java (two languages I am reasonably comfortable with). One of the tasks I tackled was backing up data to the hard drive using FileReference. FileReference is a simple way to access the file save and load functionality within a browser or otherwise. I was able to do some fairly neat things such as serializing objects and saving/loading them in a binary file. Writing XML to a file was simple. Action Script has a good amount of XML processing functionality (although sometimes a bit confusing to someone new to it) so reading the file back in was no problem. FileReference takes care of the save/load dialog and works with callbacks. It is clearly geared towards pushing the developer to make a decent user interface that doesn't lock up the render thread. (many developers don't seem to care about this kind of thing!)

FileReference (Adobe livedocs)

No comments:

Post a Comment