Thanks for your reply. That did not work as "state" is the repeating element not "states". If there are more than 1 "state" then this works fine. I don't understand why 1 element would give the ComboBox trouble.
--- In [email protected], "Hilary Bridel" <[EMAIL PROTECTED]> wrote: > > Hi, > Try changing: > > myAC = event.result.states.state; > > to > > myAC = event.result.states; > > Hilary > > -- > > On 13 Mar 2007 19:36:50 -0700, pdenys <[EMAIL PROTECTED]> wrote: > > > > I have a simple example where my ComboBox has a dataProvider that is > > an ArrayCollection. This ArrayCollection is assigned to the results > > of an HTTPService that retrieves an xml file of US States. The XML > > file is just sitting on a local web server. > > > > Why is it that when there is only 1 entry (State) in my XML file, the > > ComboBox does not populate correctly (it is blank)? > > > > Here is my XML: > > -------------- > > <?xml version="1.0" encoding="utf-8"?> > > <states> > > > > <state> > > <label>MO</label> > > <data>Jefferson City</data> > > </state> > > > > </states> > > > > Here is my code: > > --------------- > > <?xml version="1.0"?> > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> > > > > <mx:HTTPService > > id="serviceTest" > > url="http://localhost:8080/states.xml" > > result="resultHandler(event)" > > /> > > > > <mx:ComboBox id="cmbTest" labelField="label" width="300" > > dataProvider="{myAC}"/> > > <mx:TextArea width="292" id="txtTest1"/> > > <mx:TextArea width="290" id="txtTest2"/> > > <mx:Button label="Feed from file" width="285" id="btnFeed" > > click="serviceTest.send()"/> > > > > <mx:Script> > > <![CDATA[ > > import mx.collections.ArrayCollection; > > import mx.rpc.events.ResultEvent; > > > > [Bindable] > > public var myAC:ArrayCollection = new ArrayCollection(); > > public function resultHandler(event:ResultEvent):void > > { > > myAC = event.result.states.state; > > } > > ]]> > > </mx:Script> > > </mx:Application> > > > > > > > > > > -- > Hilary > > -- >

