Archive for the ‘Flex’ Category

PureMVC Tip: Notifications

Monday, September 29th, 2008

This is a somewhat obvious tip, but in the past when sending PureMVC notifications I’ve sent them with an Array as the body. This is nice for simplicity, but requires you to more or less remember what the order of parameters are and what type each is. My solution is simply to create a single value object class for notification bodies (that phrase sounds weird) sending complex data. Then you can cast the body of the notification back to its type and maintain type safety, as well as having access to any code completion.

It’s not an end-all solution, I wouldn’t expend time coding a class for simple notifications, but it certainly helps keep your command code clean and readable when you’re send more complex data.

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.

Boston Flex User Group Here at Last!

Friday, March 21st, 2008

Click here to see more information, but the gist of it is meetings on the first Tuesday of each month!

The first meeting is April 8th at 7PM at Adobe’s offices in Newton, MA. Topic will be the open sourcing of the Flex SDK.

I’ll be there, and if any of my readers will be too, drop me a line.

Flex Blog Engine

Thursday, March 6th, 2008

In the past week or so I’ve begun development on a Flex-based Blog Engine. I don’t have any screenshots or videos of it yet, as it is not entirely functional yet.

It uses Flex,PureMVC, PHP, MySQL, and WebOrb for PHP.

In the meantime, check out the preliminary information and keep an eye out for updates!