0 Replies Latest reply on Jun 12, 2007 10:22 AM by xrum

    External xml

    xrum Level 2
      ok, so now i'm trying to load that same complex xml via URLoader.
      i found many examples online, and tried to implement, but something is still wrong


      Code:
      var company:XML;
      var loader:URLLoader = new URLLoader();
      var request:URLRequest = new URLRequest("AO_XML.xml");
      loader.load(request);
      loader.addEventListener(Event.COMPLETE, onComplete);

      function onComplete(event:Event):void
      {
      var loader:URLLoader = URLLoader(event.target);
      company = new XML(loader.data);
      trace(company.toXMLString());
      }
      error message:
      Severity Description Resource In Folder Location Creation Time Id
      2 1120: Access of undefined property request. SearchTest.mxml SearchTest line 39 June 12, 2007 1:11:49 PM 597
      Severity Description Resource In Folder Location Creation Time Id
      2 1120: Access of undefined property onComplete. SearchTest.mxml SearchTest line 40 June 12, 2007 1:11:49 PM 599
      Severity Description Resource In Folder Location Creation Time Id
      2 1120: Access of undefined property loader. SearchTest.mxml SearchTest line 39 June 12, 2007 1:11:49 PM 596
      Severity Description Resource In Folder Location Creation Time Id
      2 1120: Access of undefined property loader. SearchTest.mxml SearchTest line 40 June 12, 2007 1:11:49 PM 598

      on these two lines.
      am i doing something wrong again?


      Code:
      loader.load(request);
      loader.addEventListener(Event.COMPLETE, onComplete);

      sorry for bugging you guys with this.