1 Reply Latest reply on Jun 15, 2006 12:02 PM by milostea

    Compiler error

    milostea
      We can't figure out why the class definition is fine and compiles fine but the second that we define the variable in the application, we get the errors below:

      Attempted access of inaccessible method "connected" through a reference with static type flash.net:XMLSocket"."

      Attempted access of inaccessible method "length" through a reference with static type String".

      Our app looks like this:

      <mx:Script>
      <![CDATA[
      import IDTMAN.MANSocket;
      import IDTMAN.IDTXml;
      import flash.events.*;

      namespace IDTTEST;
      use namespace IDTTEST;

      IDTTEST var xmlTest:IDTXml;
      IDTTEST var conSocket:MANSocket;

      public function initApp():void
      {
      xmlTest = new IDTXml();
      conSocket = new MANSocket();
      }

      ]]>
      </mx:Script>

      The errors are related to the "conSocket" variable. One points to a "connected()" method in a XMLSocket variable and the other is a "length()" method in a String.

      Can anybody help me discern what the problem is?
        • 1. Re: Compiler error
          milostea Level 1
          OK. I figured out the problem.

          Compiler error is so bizarre that it became a misleading factor in my search for an answer. The problem is that the "connected" and "length" methods are properties in the XMLSocket and String classes. One can not write 'str.length()' or 'sckt.connected()'. I removed the parenthesis and everything was fine afterwards.