8 Replies Latest reply on Jan 3, 2009 1:20 PM by kglad

    1120: Access of undefined property

    anney1120
      This happend many times. I just copy and paste examples from books to learn Flash, but when I complie it, there are always error messages saying variable or property undefined. Is there some setting I need to do to avoid this? The errors and the codes are below. Thank you so so so much and happy New Year!

      Error:
      1120: Access of undefined property of timeTxt
      1120: Access of undefined property of callBtn


      Codes:

      var phpFile:String= " http://www.love2earth.com/flashTest/exampleConn.php";


      function callServer (e:MouseEvent): void
      {
      var urlRequest:URLRequest= new URLRequest (phpFile);

      var loader:URLLoader= new URLLoader();
      loader.addEventListener(Event.COMPLETE, serverResponse);
      loader.load(urlRequest);
      }

      function serverResponse (e:Event):void
      {
      var loader:URLLoader= URLLoader(e.target);
      var variables:URLVariables= new URLVariables (loader.data);
      timeTxt.text=variables.returnValue;
      }

      callBtn.addEventListener(MouseEvent.CLICK, callServer);