0 Replies Latest reply on May 3, 2007 8:23 AM by yarkehsiow

    LocalConnection and attachMovie...

    yarkehsiow Level 1
      SORRY(BUT FOR ANYONE INTERESTED, THE PROBLEM WAS THE WORD "THIS" IN THE RECIEVING SWF... CHANGED TO _ROOT AND IT WORKS)

      hello,
      in the first (sending) swf is this code:
      ***************************************************
      one.onRelease=function(){
      var nChosen:Number=1;
      var sending_lc:LocalConnection = new LocalConnection();
      sending_lc.send("lcNumber", "methodToExecute", nChosen);
      }
      two.onRelease=function(){
      var nChosen:Number=2;
      var sending_lc:LocalConnection = new LocalConnection();
      sending_lc.send("lcNumber", "methodToExecute", nChosen);
      }
      ***************************************************

      and in the recieving .swf:
      // Code in the receiving SWF file
      this.createTextField("result_txt", 1, 10, 10, 100, 22);
      result_txt.border = true;
      var receiving_lc:LocalConnection = new LocalConnection();
      receiving_lc.methodToExecute = function(nChosen:Number) {
      this.attachMovie("circle"+nChosen, "circle", this.getNextHighestDepth(), {_x:180, _y:18});
      result_txt.text = nChosen;

      };

      receiving_lc.connect("lcNumber");
      ***************************************************

      the textField properly displays nChosen, but the movieClip is not attaching (yes, the linkage name is set up, they are circle1 and circle2)

      help appreciated thanks!