3 Replies Latest reply on Nov 5, 2009 6:56 AM by Ned Murphy

    Problem with array again

    MarionMacDonald Level 1

      I'd appreciate someone checking this out for me - can't see where I'm going wrong.

       

      On stage, I have 6 movies with instance name box1_btn, box2_btn etc.  Each contain another movie instanced miniSubmenu.  miniSubmenu contains dynamic text with instance name btnText.

       

      for (var z = 0; z<4; z++) {
         var buttonName = "box"+(z+1)+"_btn.miniSubmenu.btnText";
         buttonName = arrSubmenu[z].itemBrief;
         this.buttonName.btnText = arrSubmenu[z].itemBrief;
         trace(arrSubmenu[z].itemBrief);     //this traces correctly
         trace(buttonName);                      //I believe this traces correctly, ie "box1_btn.miniSubmenu.btnText" etc

      }

       

      The dynamic text remains blank.

       

      Is it that I can't use a variable for a movieclip name?  I'm sure I've one this before.  I did try using an array (  arrMCs.push("box"+(z+1)+"_btn.miniSubmenu.btnText"); ) but that didn't work either.

       

      Thanks