Here is a simple example ripped from an old app which should help:

<?xml version="1.0" encoding="ISO-8859-1"?>
<media>
        <content type="video">
                <title>Krome</title>
                <url></url>
<description>Dr Krome on the scratch using 2 turntables from the boogie down bristol...</description>
        </content>
        <content type="video">
                <title>D-Styles</title>
                <url></url>
                <description>Sick video from D-Styles cliffords 
mustache</description>
        </content>
</media>

private function onComplete( event:Event ):void
                {
                        var media:XML = new XML( urlLoader.data );
                        
                        for each(var item:XML in media..content)
                    {
                                // Custom playlist Value Object
                                var pl:PlaylistVO = new PlaylistVO();
                                
                                pl.title = String(item..title);
                                pl.url = String(item..url);
                                pl.description = String(item..description);
                                playlist_ac.addItem( pl );
                
                    }
                }

Cheers,

Simon

newtriks.com

On 3 Jul 2008, at 17:07, kirilminevgroups wrote:

I need to fill an ArrayCollection from XML object.

I have my result event which returns string with xml structure:

<NFS>
- <Trade>
<OrNo>0000000Y</OrNo>
<Date>6/10/2008 6:25:00 AM</Date>
<IP>xx.xxx.xx.xx</IP>
<Ex>CBOT-A</Ex>
<A>Add</A>
<Trd>xxx</Trd>
<W2G>15</W2G>
<W2E>15</W2E>
<G2E>0</G2E>
</Trade>
</NFS>

For example this is how I am filling my XML object:

var xml:XML = new XML(event.result);

Then I need to fill my array collection and even though I tried
everything possible I could think of no success.

I tried that with no success: var tmpData:ArrayCollection = xml.NFS.Trade;

Anyone who can help???

Thanks in advance.




Reply via email to