Posts Tagged ‘Adobe AIR’

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

Pitching Flex to College Professors

Wednesday, February 6th, 2008

Yesterday I had the opportunity to pitch Flex to a few of my college professors with the potential of it becoming an advanced course offering. To give you an idea of the demographics I was working with, all of the professors here have had experience with web design, and a couple have worked with Flash traditionally in the past. I worked on a Flex project independently this past Fall, so they had been seeing me come into class excited about something I had done the previous evening. Needless to say, they were curious about what this technology was, so it was decided I was to give them a presentation to show them what Flex could do. I jumped at the opportunity to get others excited about Flex, particularly because I would love to see my college pick it up as a course.

I started off by showing a few examples such as Buzzword. I also gave a brief rundown of the history of Flex, so that they could understand where Flex is, where it had been, and where it was going. I also briefly touched on. Next, I introduced them to Flex Builder. I showed how the design view works and the code that was generated as a result. Custom components were briefly touched on. I also showed some of the data-related features such as binding, HttpService, and data providers.

To show the visual side of Flex, I loaded up Illustrator and showed the skinning extensions for integration into CS3 that are coming out with Flex 3. Lastly, I teased them with screenshots of Thermo and explained how it will put power into the designer’s hands for UI design.

Their responses were pretty much the same: “Wow.” One of my professors commented that she now knew why I was so excited about Flex. In fact, doing this presentation had the effect of imbuing even more excitement into me. After several minutes of excited chit-chat and Q&A, we came to the inevitable question of: “What next?” They’d just been shown an amazing technology that is changing the web development world dramatically and now understood why.

We decided that next Monday I will be doing a more extended presentation by programming a complete, but simple, application for them live. I’m looking forward to this very much and will probably do a dry run this weekend. I have yet to draft what I’m going to do, but my priorities are to illustrate data services, ActionScript vs. MXML coding, and a more in depth introduction to working within Flex building, possibly showing things such as debugging. I would like to integrate application structure into it, but due to the short time frame, I will code only the simplest MXML and ActionScript.

Keep an eye out, I will post about the results of this next week and probably include the sample application I develop.