Hi Sindhu

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="vertical"
initialize="srv.send()" >
    <mx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;
            import mx.controls.Alert;
            import mx.controls.Label;
            import mx.rpc.events.ResultEvent;
            import mx.rpc.events.FaultEvent;
            public var arremp:ArrayCollection=new ArrayCollection;
           * [Bindable]
            public var idArray:ArrayCollection = new ArrayCollection(); *
            private function rsevent(e:ResultEvent):void
            {
                *var resXML:XML = e.result as XML;
                for each(var s1:XML in
resXML.tblEmpDetails.empdetails.empId)
                {
                    idArray.addItem(s1);
                }
                for(var i:int=0;i<idArray.length;i++)
                 {
                    Alert.show("id = "+idArray.getItemAt(i));
                 }*

            }
             private function flevent(e:FaultEvent):void
            {
                Alert.show('fault '+e.fault.toString());
            }
            private function rep():void
            {
                lb.text=dg.selectedItem.empname;
            }
        ]]>
    </mx:Script>
    <mx:HTTPService id="srv" url="employeexml.xml" result="rsevent(event)"
fault="flevent(event)" *resultFormat="e4x"*/>
    <mx:DataGrid id="dg"  x="239" y="29" change="rep()" />
    <mx:Label id="lb" width="500"  x="258" y="377"/>
</mx:Application>


u can convert from XML to ArrayCollection by using *for each*

here i converted empid ArrayCollection from XML
similarly u can convert empname , empsalary , empgender

Any doubts mail us

I hope it will help u


Regards
NatarajanV

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to