3 Replies Latest reply on Aug 19, 2007 2:13 PM by lukemack

    Accessing XML from actionscript

    lukemack
      Hi,

      I am trying to do the following in a flex application (it is stright from the help file):

      var myXML:XML = new XML();
      var XML_URL:String = "i have put my url in her e and i know that it works";
      var myXMLURL:URLRequest = new URLRequest(XML_URL);
      var myLoader:URLLoader = new URLLoader(myXMLURL);
      myLoader.addEventListener("complete", xmlLoaded);

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

      but i get the errors:

      1120: Access of undefined property myLoader. main.mxml
      1120: Access of undefined property xmlLoaded. main.mxml

      in the problems pane.

      do I need to import some classes or something? I am used to Flash AS 2 in Flash8 but havent used that in a while. This should be something obvious I have missed?

      thanks for any replies!

      lukemack.