2 Replies Latest reply on Jul 2, 2006 3:23 AM by Dauntless

    Using LocalConnection

    Dauntless
      Hi!

      I'm building a very small app to test some things, but I can't get it to run... The Flex Builder is giving errors but I don't know why ...

      This is the code:

      <?xml version="1.0" encoding="utf-8"?> of
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:Script>
      import flash.net.LocalConnection;
      private var myLC:LocalConnection = new LocalConnection();
      myLC.client = new CustomObject();
      myLC.connect("test_lc");

      </mx:Script>
      </mx:Application>


      And my CubomObject file, wich is in the base folder (so the base claspath)

      package
      {
      public class CustomObject extends Object
      {
      public function methodHandler(message:String = ""):void
      {
      trace("bericht ontvangen: "+message);
      }
      }
      }

      Flex Builder gives an error on the third script line in my mxml file. It says: "Access of undefined property myLC. And it gives the same error on the 4th line ...

      Why is this ?