jump to navigation

receptionist friendly flash 10 xml editor October 21, 2009

Posted by headwinds in Development, Flash, Gaming.
trackback

meggie

XML is so simple even Maggie Gyllenhaal could update it but she never would; nor would your receptionist or even your PM.

In theory, non-technical people should be able to edit xml files. Creating configurable xml files are a relatively cheap solution to content management over one driven by a database. XML is really meant for other developers to manage your compiled work without having to dig around your source looking for variables.

On a side note, I’ve been building a lot of html, css and javascript lately so that I can eventually claim to be a true front-end developer not just a one-trick Flash pony. I’ve grown to realize that there is a cool conversation happening with html these days and I should be more versed in it. But I’ll save that tangent for another post. I only mention it here because I’m working with a django developer and learning django tags. In the django documentation, there is a line about the pains of having to hand write xml which they call “sadistic”.

As much as you try to keep it organized, xml becomes increasing more challenging to work with as the data grows beyond 100 lines. It would be nice to have something like form-based editor for it which could create the xml behind the scenes. But you need to model the xml first before you can create the editor. In most cases, its simply faster to edit the raw xml.

With the introduction of Flash player 10, we can now develop xml editors in CS4 without using AIR or ZINC. We have a new method on filereference: save(). We can use save to open file dialog so that the user can save the new file to their desktop. Currently, there is a bug though in the save method which won’t allow you to overwrite existing files — it will attempt to and actually append your data to the end of the file which isn’t good especially when dealing with xml.

You can get around this bug by creating a new file each time. In the below example, I simply added a timestamp to my file name to avoid this problem. Then, when I need to load this xml file, I open the latest version. Here is a small code sample demonstrating this save work around:

view code sample
download code sample

I liked these two blog posts about the filereference features and the known save bug:
deleteaso.com
dynamicflash.com

This post is a little backwards. I’m showing you a code sample before I reveal its purpose.

I like to evaluate new features in Flash by creating mini game engines. In order to get more comfortable with filereference and potentially use it my client work, I decided to design/develop a story editor which would allow me create reams of xml for a story-driven game like Mass Effect. For this exercise, I did the wireframing and coding simultaneously. This felt natural to me as I basically had an idea of what the end interface would look like, and, as I discovered missing controls, I could add them and wire them up as I went along. It’s a strange feeling when your interface starts to speak to you and recommends new features ;-D.

wireframe

Along with the ability to create/edit scenarios, you can see a few other features sketched in this working wireframe like an image option which doesn’t do anything yet; the preview scenario which will show the images and cycle through the scenarios; and the bizarre “male” reference in the top right that tells me that this scenario is written from the main man’s point of view. I have to plans to add female, alien, and possibly unicorn POVs.

After the recent Adobe announcement about how they had managed to circumvent the Flash player on the iPhone by developing a way to convert AS3 to a native iPhone app, I did a black flip back into Flash and have pretty much abandoned my shallow dives in Android and Objective C. I’ll thrilled to be focusing on Flash again with some complementary side steps into javascript.

As much I know this scares some hardcode Apple developers who fear we’ll fill their precious little wonder with trivial bubble wrap apps, I’m dreaming of serious Flash games and apps on the iPhone now as an extension of our greater advertising campaigns that will uniquely consider an iPhone’s hardware requirements. As soon as CS5 is ready, I hope to have a Flash mobile game but in the meantime I’m starting to look at many of the Flash gaming portals with their reduced desktop space that seem like an ideal tank to test the waters.

Comments»

No comments yet — be the first.