1 Reply Latest reply on Jan 31, 2007 2:51 PM by phi2265

    Newbie & xml

    Level 1
      Hi,

      Copied this from some Adobe help file and it just gives me an error "Access of undefined property completeHandler".

      <?xml version="1.0"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">
      <mx:Script>
      <![CDATA[
      var loader:URLLoader = new URLLoader(new URLRequest("params.txt"));
      loader.addEventListener(Event.COMPLETE, completeHandler,false,0.0,false);

      private function completeHandler(event:Event):void
      {
      var loader2:URLLoader = URLLoader(event.target);
      trace(loader2.data);
      }
      ]]>
      </mx:Script>
      </mx:Application>

      What am I doing wrong? Any help appreciated.

      Paul

        • 1. Re: Newbie &amp; xml
          phi2265 Level 1
          you cant just have
          loader.addEventListener(Event.COMPLETE, completeHandler,false,0.0,false);
          in the script code, you need to make a function that runs on the application creationComplete and put
          loader.addEventListener(Event.COMPLETE, completeHandler,false,0.0,false);
          in that function.