2 Replies Latest reply on Jun 7, 2011 1:33 PM by Ned Murphy

    Converting AS3 to AS2. Some movieclip buttons not working.

    sirrahe

      25 movieclip buttons in frame 126 maintimeline. Buttons are on top layer above all other content.

      Buttons 1_1, 2_1, 3_1, 4_1, and 5_1 work. All buttons have correct instance name. The buttons are in a 5x5 grid. Hence the naming convention of column_row. So all row 1 buttons are working. Do not get hand cursor over any of the other buttons. This is totally baffling. I am using Flash CS4. The file is saved as CS3 and the publish settings are AS2, Flash player 8.

       

      Here is the AS for frame 126.

      stop();
      trace("tScore = "+tScore);
      trace("i = "+i);
      if (i == 0) {
          i++;
      }
      this.podium.signin.unloadMovie();

       

      videoBtn1_1.onRelease = function() {
          gotoAndStop(127);
          videoBtn1_1.play();
      };
      videoBtn2_1.onRelease = function() {
          gotoAndStop(127);
          videoBtn2_1.play();
      };
      videoBtn3_1.onRelease = function() {
          gotoAndStop(127);
          videoBtn3_1.play();
      };
      videoBtn4_1.onRelease = function() {
          gotoAndStop(127);
          videoBtn4_1.play();
      };
      videoBtn5_1.onRelease = function() {
          gotoAndStop(127);
          videoBtn5_1.play();
      };
      this.videoBtn1_2.onRelease = function() {
          gotoAndStop(127);
          videoBtn1_2.play();
      };
      videoBtn2_2.onRelease = function() {
          gotoAndStop(127);
          videoBtn2_2.play();
      };
      videoBtn3_2.onRelease = function() {
          gotoAndStop(127);
          videoBtn3_2.play();
      };
      videoBtn4_2.onRelease = function() {
          gotoAndStop(127);
          videoBtn4_2.play();
      };
      videoBtn5_2.onRelease = function() {
          gotoAndStop(127);
          videoBtn5_2.play();
      };
      videoBtn1_3.onRelease = function() {
          gotoAndStop(127);
          videoBtn1_3.play();
      };
      videoBtn2_3.onRelease = function() {
          gotoAndStop(127);
          videoBtn2_3.play();
      };
      videoBtn3_3.onRelease = function() {
          gotoAndStop(127);
          videoBtn3_3.play();
      };
      videoBtn4_3.onRelease = function() {
          gotoAndStop(127);
          videoBtn4_3.play();
      };
      videoBtn5_3.onRelease = function() {
          gotoAndStop(127);
          videoBtn5_3.play();
      };
      videoBtn1_4.onRelease = function() {
          gotoAndStop(127);
          videoBtn1_4.play();
      };
      videoBtn2_4.onRelease = function() {
          gotoAndStop(127);
          videoBtn2_4.play();
      };
      videoBtn3_4.onRelease = function() {
          gotoAndStop(127);
          videoBtn3_4.play();
      };
      videoBtn4_4.onRelease = function() {
          gotoAndStop(127);
          videoBtn4_4.play();
      };
      videoBtn5_4.onRelease = function() {
          gotoAndStop(127);
          videoBtn5_4.play();
      };
      videoBtn1_5.onRelease = function() {
          gotoAndStop(127);
          videoBtn1_5.play();
      };
      videoBtn2_5.onRelease = function() {
          gotoAndStop(127);
          videoBtn2_5.play();
      };
      videoBtn3_5.onRelease = function() {
          gotoAndStop(127);
          videoBtn3_5.play();
      };
      videoBtn4_5.onRelease = function() {
          gotoAndStop(127);
          videoBtn4_5.play();
      };
      videoBtn5_5.onRelease = function() {
          gotoAndStop(127);
          videoBtn5_5.play();
      };

        • 1. Re: Converting AS3 to AS2. Some movieclip buttons not working.
          sirrahe Level 1

          Greetings

          I have solved the problem though I do not know why this works.

           

          I moved each row of buttons to their own layer.

           

          I would love to know what the issue was with all the buttons existing on the same layer.

          Thanks

          • 2. Re: Converting AS3 to AS2. Some movieclip buttons not working.
            Ned Murphy Adobe Community Professional & MVP

            You can probably reduce all that interaction code to a loop...

             

            for(i=1; i<6; i++){

               for(k=1; k<6; k++){

                  this["videoBtn"+i+"_"+k].onRelease = function() {
                      gotoAndStop(127);
                      this.play();

                  }
            }

            As for why movng the buttons to another layer fixed anything, it will not have mattered.  Whatever fixed the problem will remain a mystery.  It could have been an issue with instance names/frames since you are at frame 126 for some reason.  If you transition the buttons into place, that might be related to what the problem was.

            1 person found this helpful