1 Reply Latest reply on Apr 30, 2008 1:57 PM by jc_2006

    attach movie  + choosing an array

    yogi bear Level 1
      I am attaching a new movie from a menu and want to be able to choose a specific array from a number of arrays on the attached movie clip. I thought by passing movieID in the code to the new movie clip would work to choose the array when making the new drop down menu. It doesn't and I'm stuck on where to go. Any ideas are appreciated.

      var projectMenu:Array = [["Red", "redMenu"], ["Blue", "blueMenu"]];


      xStart = 0;
      yStart = 20;
      ySpacing = 18;


      for(counter = 0; counter<projectMenu.length; counter ++){
      var copy:MovieClip = attachMovie("master", "copy" + counter, counter);
      copy._x = xStart;
      copy._y = (counter * ySpacing)+36;
      copy.main_text.text = projectMenu[counter][0];
      copy.menuID = projectMenu[counter][1];

      copy.item_btn.onPress = function () {
      itemProjectClicked (this._parent.menuID, this._parent.main_text);



      }
      };


      function itemProjectClicked (menuID:String, main_text:String){
      _root.attachMovie("sub_menu", "menu" + counter, 10, {newMenu: menuID, name_txt: main_text, _x:190, _y:135});
      }



      //attach movie sub_menu starts out like this

      var name_str:String;
      name_txt.text = name_str;


      var redMenu:Array = [["Item1", "Item1.swf"], ["Item2", "Item2.swf"]];
      var blueMenu:Array = [["Item3", "Item3.swf"], ["Item4", "Item4.swf"]];


      // then uses code is similar to above with "menuID" subsituted for "projectMenu"