Hi Tracy, this is how I get the XML info into an ArrayCollection:

<mx:HTTPServiceurl="days.php" useProxy="false" method="POST" id="Days" 
resultFormat="e4x" result="get_days(event)">

privatefunctionget_days(event:ResultEvent):void{
Arraydays.removeAll();
XMLdays = event.result asXML;foreach(varourxml:XML inXMLdays.elements()) 
Arraydays.addItem(ourxml);}

Is this ok?

Thanks

-David



________________________________
From: Tracy Spratt <[email protected]>
To: [email protected]
Sent: Tuesday, February 10, 2009 4:19:53 PM
Subject: RE: [flexcoders] ArrayCollection DataProvider question.


I suggest using e4x expressions against the XML, and then putting the result in 
an XMLListCollection.
var xlResults:XMLList = xmlData.result. (attribute(“id”) == “1”);
trace(xlResults. toXMLString( ));  //to verify your data
xlcResults = new XMLListCollection( xlResults) ;
 
You did not say how you got your XML into an ArrayCollection, but I suspect it 
is not the good way.
Tracy Spratt
Lariat Services
Flex development bandwidth available

________________________________

From:flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On 
Behalf Of Henrique
Sent: Tuesday, February 10, 2009 2:19 PM
To: flexcod...@yahoogro ups.com
Subject: Re: [flexcoders] ArrayCollection DataProvider question.
 
Humm, you have to make a filterFunction, like this:
 
private function filterFucntion( item:Object) :Boolean
{
   return item.id == "1";
}
 
Henrique F. Marino
blog.dclick. com.br
www.dclick.com. br
On Tue, Feb 10, 2009 at 3:35 PM, sailorsea21 <sailorsea21@ yahoo.com> wrote:
I loaded the following xml as an ArrayCollection. 

<data>
<result id="1">
<date>today</date>
<yes>13154</yes>
<no>654321</no> 
</result>
<result id="1">
<date>yesterday</date>
<yes>21354</yes>
<no>5468432</no> 
</result>
<result id="2">
<date>today</date>
<yes>2665</yes>
<no>4256</no> 
</result>
<result id="2">
<date>yesterday</date>
<yes>7425</yes>
<no>7542</no> 
</result>
</data>

How can I use this as a dataprovider but only using the values in 
<result id="1"> and not <result id="2">?

My arraycollection var is "Arraydays".
I tried {Arraydays.( @id=='2')} but it gave me an error: Error #1123: 
Filter operator...

Thanks.
 



      

Reply via email to