2 Replies Latest reply on May 21, 2008 8:16 PM by wildkatana

    Problem with URLLoader

    wildkatana
      Hello, I am trying to load an XML from a url into a variable so that I can access it in my Flex application. I have this code:
      var myXML:XML = new XML();
      var XML_URL:String = " http://gdata.youtube.com/feeds/api/videos?vq=football+-soccer&orderby=published&start-inde x=11&max-results=10";
      var myXMLURL:URLRequest = new URLRequest(XML_URL);
      var myLoader:URLLoader = new URLLoader(myXMLURL);
      myLoader.addEventListener("complete", xmlLoaded);

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

      And the errors I am getting are:
      1120: Access of undefined property myLoader.
      1120: Access of undefined property xmlLoaded.

      I tried importing flex.net.* and I tried making the myLoader variable public, all to no avail.. Any ideas?