4 Replies Latest reply on Feb 9, 2007 7:08 PM by NewYorkled

    .onPress problem after .attachMovie

    NewYorkled
      Hello, I'd appreciate some direction with this. Here's the code found within one MC acting like a button:
      it all works great except that the movieClip which is attached refused to respond to the .onPress event. NOTE: that it works perfectly as it should if I take the code that brings in the MC and put instead into the root of the file. But it gets weird when done from within the button.

      stop();
      this.buttText.textColor = 0xFFFFFF;
      this.buttText.text = "HOME";
      var c1 = 0;
      this.onRollOver = function() {
      buttText.textColor = 0x0000FF;
      myRows1 = 4;
      myCols1 = 3;
      for (var aa = 0; aa < myCols1; aa++) {
      for (var a = 0; a<myRows1; a++) {
      var myClip = this.attachMovie("myButtsMain", "myButtsMain" + c1, c1++);
      myClip._y = myClip._height*a+myClip._height;
      myClip._x = myClip._width*aa;
      myClip.onPress = function() {
      };
      }
      }
      }
      this.onRollOut = function() {
      for (var aaa = 0; aaa < myRows1 * myCols1 + 1; aaa ++) {
      removeMovieClip("myButtsMain" + aaa);
      }
      }

      I'd appreciate any help with this. Thanks in advance.