Driving Flash with data from a Google Docs Spreadsheet

I read an article recently describing this concept at CoderHump. Ben Garney used it to make it easier for game artists and designers to tweak game settings without training them on an API or building and maintaining a separate tweak input tool for them to use.

This concept takes advantage of a useful feature of Google Docs spreadsheets: they can be set up to publish in ATOM format, which is XML. You can lay out columns and rows so that they correspond to variables and values like a flat-file database. There are docs on the API.

Like any Google Doc, you can set up access control if you want. If you want multiple editors, think carefully about how you deal with unexpected values. It would be nice if there was cell-level protection.

Step-By-Step

Google Docs:

Create a spreadsheet. Put in a couple columns and rows worth of data, such as the days of the week in column one and their corresponding name in Spanish in column two. (This could be an awesome translation tool, no?).

The settings you need are in the Share Tab on the Right:

Using Sharing settings… , publish the spreadsheet so that it is publicly viewable:

Then open the pubish as a Web Page settings from the same settings tab:

Change the dropdown menu from Web page to ATOM…

… and copy the ATOM URL to use in ActionScript.

Flash: Load the XML using the URL for the ATOM feed as the URLRequest string.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha loading...

This site uses Akismet to reduce spam. Learn how your comment data is processed.