4 Replies Latest reply on Apr 19, 2006 3:21 PM by truly_great

    Importing XML in Flex 2.0

    truly_great
      I am trying to import an external XML doc into my Flex app and I am trying to use their coding: I placed the contents of the XML file directly into the source of the Flex app and it worked perfectly, but now when I am trying to import it, it just sits there and says there are errors of "Expecting rightparen before semicolon".

      <mx:Tree width="640" height="237" id="outline_tree" labelField="@label" showRoot="false" verticalCenter="3" left="25">
      <mx:dataProvider>

      var myXML:XML = new XML();
      var XML_URL:String = " http://website/folder/outline2.xml";
      var myXMLURL:URLRequest = new URLRequest(XML_URL);
      var myLoader:URLLoader = new URLLoader(myXMLURL);
      myLoader.addEventListener("complete", xmlLoaded);

      function xmlLoaded(evtObj:Event) {
      myXML = XML(myLoader.data);
      trace("Data loaded.");
      }

      </mx:dataProvider>
      </mx:Tree>

      At first I tried putting the XML coding inside a <mx:XML> tag, but it said it was improper use of it.

      Any ideas?

      Thia