4 Replies Latest reply on Oct 7, 2009 7:37 AM by camfieldaj

    XML and e4x


      I am having problems parsing XML data with e4x.


      My code is


                  import mx.rpc.http.mxml.HTTPService;
                  import mx.rpc.events.ResultEvent;
                  // The initialisation function
                  protected function init():void {
                      var serviceObj:HTTPService = new HTTPService();
                      serviceObj.resultFormat = "e4x";
                      serviceObj.method = "GET";
                      serviceObj.useProxy = false;
                      serviceObj.addEventListener(ResultEvent.RESULT, processResult);
                      serviceObj.url = 'http://localhost/myScriptURL.php';

                  // The result processing function
                  protected function processResult(event:ResultEvent):void {
                      // make sure the response is cast as the correct data type
                      var XMLResults:XML = event.result as XML;
                      MyDataGrid.dataProvider = XMLResults.user;
          <mx:DataGrid id="MyDataGrid" />



      The XML is definetley returned as it appears in my trace statement but the data grid does not get populated.


      I've been looking at lots of tutorials and have tried following them but with no luck.


      Can anyone point out where I am going wrong?


      Thanks for any help