Managing Google Spreadsheets from Flex

Update:

Check out this…

http://www.wookets.com/code/flex/GSpreadUpdater/

It uses a nice wrapper class from http://www.farinspace.com/saving-form-data-to-google-spreadsheets/.

Don’t try to update / search on values which have - in the cell… I don’t know, it didn’t like it whenever I did it… Probably have to escape it…

Old post:

Example and source:

http://wookets.com/code/flex/GSpreadDemo/

The example is broken, because you’ll need a google username and password to access any spreadsheets (event public ones)… I could have let you put in your own google username and password in the flex app and send them over the wire (to the php service), but I’d rather not have people entering account information to a demo app. So, download the source (right click on the app) and run it on your own local server with your info. It should work.

How this works: The flex app sends simple POST (or you can use GET) to a php service which connects to the google spreadsheet api. The php service then sends back XML with the data.

Not all functionality is implemented, because I have what I need for my project, but if you add on to this, feel free to leave the code here.

The crossdomain.xml for google docs prohibits one from directly working with the api via a flash application. If this changes, the php service would not be necessary, but perhaps it’s better to have our account information on a serverside script? Not something that could be decompiled / introspected.

Note, I couldn’t for the life of me get HTTPService to work. Not the mxml, not the as3. I use RemoteObject all of the time, so I don’t know what’s going on. URLLoader is used in its place. Yeah, it feels ghetto, but I created a as3 class to hopefully provide some of the same functionality (you can finish off the fault handling if you want)…

Published by using 307 words.