Posts

Showing posts from October, 2008

Today I'm a developer

For the last few weeks I have been a Flex developer, and I've learned about something really helpful.

Flex value objects.

Well these little AS classes have saved me some heartache and headaches. I was dumping everything into an xmlListCollection and then creating ArrayCollections of display objects with the data from the xmlListCollection. It started to get messy. No more! Value objects are way easier to manage.

Here’s an example of how to create one in case you’ve never done it before. (ps this is using the Cairngorm framework).

Okay first things first. What are you going to pull from your xml? In my example I am pulling a "Section" and each Section has a "SubSection". In this case I'd need two value objects. One for my Section and one for my SubSection. Stick them in a folder called vo.

Here is my SectionVO.as:


package com.vo
{
import com.adobe.cairngorm.vo.ValueObject;
import mx.collections.ArrayCollection;

[Bindable]
public class SectionVO implements Val…