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:

Tuesday, August 11, 2009

Dynamic Input SWF's

One of our favorite features in Livebrush is the dynamic input behavior style. All the styles in Livebrush include a default dynamic input. To use it, change the Input style to "Dynamic". But this post isn't about using dynamic inputs - it's about creating your own.

What are Dynamic Input Behaviors?
Dynamic inputs are simple SWF files that are used in place of, or in combination with your mouse input. They allow you to dynamically control the brush tool in Livebrush. And the only thing you need to know in order to create these files is a little Actionscript 3.

Why use Dynamic Input Behaviors?
Maybe you're more interested in generative art. Or maybe you're looking for more than the built-in 'Live Controls'. In any case, we feel this feature is the most open-ended.

Getting Started
Download these basic dynamic input source files (you'll need Flash 9 or greater). Each zip file contains a FLA, SWF, and AS file. When you open the FLA and AS files in Flash you'll notice that each file has comments and instructions to help you get started.
BasicBrushControl
SmoothRandControl

Limitations
- For security reasons, dynamic input SWF's can't access online content (for now)
- SWF's must be exported for Flash 9 using Actionscript 3 (Flash 10 not supported yet).

Post a comment if you need more help. Or visit the forum to share your creations.

Open source & The Livebrush Project

I thought it'd be best to openly discuss some of the emails I've been answering in regards to open source and the purpose of this site.

What you'll find on this site:
Everything that has gone into Livebrush, and everything that we have planned will be openly discussed here. Specifically this means lots of Actionscript, Adobe AIR, and Flash Platform code and information. The main goal is to help others in regards to using creative tools and developing creative tools.

Interaction and motion related topics will also be discussed here. These, and many other topics may not always be related to Livebrush. But I hope they'll always be useful.

Other topics will include using and developing for Livebrush. For example, developing dynamic inputs for Livebrush. Dynamic inputs are simple SWF files that are used in place, or in combination with your mouse input. They allow you to dynamically control the brush in Livebrush.

Segway to Dynamic Inputs!