6 Replies Latest reply on Jul 5, 2006 1:36 PM by jordan brough

    How do you load external XML into a dataProvider?

    jpwrunyan Level 1
      I have been looking through the docs and have found a couple of entries discussing how to load external XML. Unfortunately, that is where the example stops and there is no example of doing anything useful with that data.

      I have managed thus far to get my XML file loaded into actionscript/flex:
      function getExternalXML():void {
      request = new URLRequest('source.xml');
      loader = new URLLoader();
      loader.load(request);
      loader.addEventListener("complete", loadXML);
      }
      function loadXML(e:Event):void {
      combo.dataProvider = loader.data;
      }

      obviously, the above doesn't work at all. I don't know how to convert the loader.data into a format that the ComboBox.dataProvider understands. I can't believe I have to write a function to parse this XML. Surely there must be a way to simply convert the XML to an array or something???