4 Replies Latest reply on Sep 15, 2006 7:13 AM by Newsgroup_User

    implementing LocalConnection() in flex 1.5

    meticoolus Level 1
      HI All,
      I have implemented Local connection method in Flex 1.5, I have created Two mxml files by name sender.mxml and receiver.mxml,the scipt of those are below

      //===Script for Sender.mxml==

      <mx:Script>
      <![CDATA[

      function send()
      {

      var lc:LocalConnection = new LocalConnection();

      txtVar = "sometext";
      lc.connect("myConn");
      lc.send("myConn", "receiveMethod", txtVar);
      getURL("receiver.mxml"); // doubtful here
      }
      ]]>
      </mx:Script>


      //===Script for receiver.mxml==

      <mx:Script>
      <![CDATA[

      var receiveTxt :String;
      var lc2:LocalConnection = new LocalConnection();
      lc2.connect("myConn");
      lc2.receiveMethod = function(txtVar)
      {
      var receiveTxt:String;
      receiveTxt = txtVar;
      }

      ]]>
      </mx:Script>

      I guess with this code,I should be able to get the value passed to receiver.mxml.But isn't the case.
      could some one help me out pls,Can I use LocalConnection method() to pass datas between swf files?
      Pls let me know

      Thanks in advance.