Design, Development, Interaction

Thursday, August 20, 2009

XMLToFolder - Use XML to Easily Create Directory Structures in Adobe AIR

This is the first post dealing with File management in AIR. It's not the most glamorous of exercises, but still extremely useful for applications where you're creating varied directory structures on-the-fly.

Primer
This class masks the File object. But it's important to understand that the File object represents both a single file or a directory. Methods of the File object let you determine whether your object is a file or a directory. That said, this class only creates directories.

XMLToFolder is a simple class for creating directory structures using XML syntax. Usage:

Download Source & Example FLA

Features
- Supports using standard File object or a temporary directory as the parent folder
- Use a string to pass your XML folder structure

Final Notes
In creating Livebrush, stuff like this was the most daunting. As things got more complicated, I would often find myself writing countless utility classes just like this. And while fun for a while, I soon realized why libraries are crucial. But more importantly, why software development is very different from interaction development.

As always, I'd love to know if you found this post helpful (or not). And don't hesitate to make it better or point out any mistakes.

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home