Archive for the ‘Adobe AIR’ Category

Semi-Undocumented Adobe AIR File Serialization Issue

Thursday, April 17th, 2008

I’ve been having a major issue with Flex/Adobe AIR over the last week or so when serializing my data to files. I use a FileStream and call writeObject() on an ArrayCollection of my data. Pretty simple. Serializing seems to run fine, deserialization as well. The problem arises when I try to cast items in the collection to their appropriate type. It seems the objects have lost their type information and are plain Objects.

After a while of thumbing through the documentation it finally hits me. FileStream uses AMF3. Usually when using AMF3 you define RemoteClass metadata for each of your classes that mirror server-side classes. I had just assumed that since AIR knew I would be loading the object back in AIR again, it would do that stuff automatically. Turns out it doesn’t. A few lines of RemoteClass metadata later it’s working fine. You just need to define the alias as being your class with the full namespace typed out. Not in the documentation (or if it is, it needs to be in a more obvious spot such as here or here). Although knowing its was AMF3 format, I probably should have realized this sooner.

Hope this saves someone else some time.

Flex 3 and AIR 1.0 Go Live

Monday, February 25th, 2008

Flex 3 and Adobe AIR 1.0 have gone live today!

This was sooner than I’d expected (2 weeks, actually), although there have been some subtle hints from some Flex Developer blogs over the last week that it was coming very soon.

I think this version of Flex is really going to push the platform into the mainstream for Flash application development. It’s going to beĀ  an incredible boon in ways we probably don’t even see yet.

RSS Reader in Flex - Demo

Wednesday, February 13th, 2008

As I had mentioned before I presented a demo application on Monday for Flex. The best example I could come up with that wasn’t another overused Flickr demo was an RSS feed reader named “Feeder”. It demonstrated simple data services (HTTPService), databinding, Flex Builder’s Design vs. Source views, and some ActionScript event handling. I also quickly copied the code over to an Adobe AIR application just to show that most code could be resused between vanilla Flex and Flex/AIR.

I also made a point to do this in as little code as possible. In fact, it came out to exactly 30 lines of code and took about 15 minutes to code/explain. Realistically, I could have done less, but I wanted to make an app a little more significant than something that displayed RSS items in a DataGrid.

I’ve attached the source code for your curiosity. Feel free to comment and I would love to see anything anyone creates with this:

Feeder MXML Code

Humor of the Week #1: AMF is a Superhero

Wednesday, February 6th, 2008

Just though I’d share with you a humorous thought I had today, I find these are the kinds of thought that help me survive even the worst weeks. I’ll try to make this a weekly thing.

I was browsing the web and came across Adobe Edge’s February publication. There is an article for BlazeDS, including discussion of AMF on it and for some reason despite this being the 100th time I’ve seen the acronym spelled out, it finally hit me: Action Message Format Man would be a great Superhero name.

Now what would his costume look like…?