>> Could you extend this with an example on the part of:
>>"I typically do is load in XML data and create VOs from that (in my
Model
>>class) to use in my app."


Sure.  Here is an example of what the parsing might look like inside
your model class.  If your XML looked like this:


<xml>
        <people>
                <person firstName="Hank" lastName="Aaron"
phoneNumber="7043237564" indicatorColor="0xe39132" />
                <person firstName="Fred" lastName="Astaire"
phoneNumber="9082321214" indicatorColor="0xe73721" />
                <person firstName="Judy" lastName="Garland"
phoneNumber="3107382234" indicatorColor="0xd4e355" />
                <person firstName="Marilyn" lastName="Monroe"
phoneNumber="3107673721" indicatorColor="0xbab5ab" />
        </people>
</xml>

Then inside your model class, you may have some code like this (which of
course would run after the XML is loaded):

public var personVOs:Array = []; //array of PersonVOs

private function createPersonVOs():void
{
        for each (var personNodeXML:XML in myXML.people.person)
        {
                var personVO:PersonVO = new PersonVO();
                personVO.firstName = personnodex...@firstname;
                personVO.lastName = personnodex...@lastname;
                personVO.phoneNumber =
Number(personnodex...@phonenumber);
                personVO.indicatorColor =
uint(personnodex...@indicatorcolor);
                personVOs.push(personVO);
        }
}

So now, you have personVOs as a public property in your model you can
call and get the people information from their VO class.  Does that
help?  


Jason Merrill 

Bank of  America  Global Learning 
Learning & Performance Solutions

Join the Bank of America Flash Platform Community  and visit our
Instructional Technology Design Blog
(note: these are for Bank of America employees only)





-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Cor
Sent: Saturday, April 24, 2010 6:53 AM
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Quick question about dynamic groupings

Hi Jason,

Nice explaination!
Thanks!

Could you extend this with an example on the part of:
"I typically do is load in XML data and create VOs from that (in my
Model
class) to use in my app."


Kind regards
Cor van Dooren
The Netherlands
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to