Try doing something like this...
 
*********************
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:HTTPService id="statesModel" url="" result="st.dataProvider=event.result.root.state" showBusyCursor="true" fault="mx.controls.Alert.show('Could not get xml Info!!!')" />
<mx:ComboBox id="st" x="143" y="113" width="132" />
<mx:Button label="Click to get States" click="statesModel.send()" />
</mx:Application>
*********************
 
and in states.xml
*********************
<?xml version="1.0"?>
<root>
    <state>
  <label>Alabama</label>
  <data>AL</data>
 </state>
    <state>
  <label>Alaska</label>
  <data>AK</data>
 </state>
    <state>
  <label>Arizona</label>
  <data>AZ</data>
 </state>
    <state>
  <label>Arkansas</label>
  <data>AR</data>
 </state>
    <state>
  <label>California</label>
  <data>CA</data>
 </state>
    <state>
  <label>Colorado</label>
  <data>CO</data>
 </state>
    <state>
  <label>Connecticut</label>
  <data>CT</data>
 </state>
    <state>
  <label>Delaware</label>
  <data>DE</data>
 </state>
    <state>
  <label>Florida</label>
  <data>FL</data>
 </state>
    <state>
  <label>Georgia</label>
  <data>GA</data>
 </state>
</root>
 
*********************
Hope this helps,
-sam
 
On 7/24/06, Vinod M Jacob <[EMAIL PROTECTED]> wrote:

 
Hi all,
 
I am working on Flex 2.0.I am faced with a problem.I need to display data from  the .XML file into the combo box.Earlier i used mx:Model  and an array collection to display data in combo box in flex 2 Beta 3 version and it was working fine.Now i have changed the same code to flex 2 final version and it is not working.The code i used is shown below.
 
*****************************************************************************************************
 
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
 
 <mx:Model id="statesModel" source="states.xml"/>
        <mx:ArrayCollection id="StateAC" source="{ statesModel.states.state}"/>
 <mx:ComboBox id="st" x="143" y="113" width="132" dataProvider="{StateAC}"/>
</mx:Application>
 
 
******************************************************************************************************
 
 
the states.xml file is as follows
 *****************************************************************************
<states>
   <state label="Alabama" data="">    <state label="Alaska" data="">    <state label="Arizona" data=""
    <state label="Arkansas" data="">    <state label="California" data="">    <state label="Colorado" data="">    <state label="Connecticut" data=""
    <state label="Delaware" data="">    <state label="Florida" data="">    <state label="Georgia" data="">
<states>
*******************************************************************************************************
 
 
Your help in this regards will be highly appreciated.
 
Thanks,
Vinod M Jacob
 

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to