1 Reply Latest reply on Jun 25, 2007 3:34 PM by dex002

    Access of undefined property...

    dex002 Level 1
      When trying to compile AS 3.0 in Flex Builder 2, I get errors. I just can't figure out why these properties are undefined. Here is the code and the errors follow:

      <mx:Script>
      <![CDATA[

      import flash.events.Event;
      import flash.net.URLLoader;
      import flash.net.URLRequest;

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

      function onComplete(event:Event):void
      {
      var loader:URLLoader = event.target as URLLoader;
      if (loader != null)
      {
      externalXML = new XML(loader.data);
      trace(externalXML.toXMLString());
      }
      else
      {
      trace("loader is not a URLLoader!");
      }
      }



      ]]>
      </mx:Script>

      Access of undefined property loader
      Access of undefined property request
      Access of undefined property loader
      Access of undefined property onComplete

      Any help is greatly appreciated.

      Dex