2 Replies Latest reply on Mar 29, 2008 12:16 PM by yogi bear

    loop / function problem

    yogi bear
      I have created a series of button with references of swfs to load which the buttons are clicked.

      The click function only works for every third button. All the buttons and names are iterated correctly.
      Is the problem with the line item "ProjectClicked(this._parent.projectID);" or something else?
      Any help would be appreciated.

      function buildResMenu(){
      var xSpacing:Number = 130;
      var ySpacing:Number = 20;
      var xStart:Number = 0;
      var yStart:Number = 0;
      var count:Number = 0;
      for (i=1; i<4; i++) {
      for(j=0; j<3; j++) {
      count++;
      var name:String = "menu2" + count + "_mc";
      _root.m2.attachMovie("flipper", name, count);
      _root.m2[name]._x = (i * xSpacing) - 130;
      _root.m2[name]._y = j * ySpacing;
      _root.m2[name].main_text.text = resMenu[count-1][0];
      _root.m2[name].projectID = resMenu[count-1][1];
      }


      _root.m2[name].item_btn.onPress = function () {
      itemProjectClicked(this._parent.projectID);


      }
      }
      }


      ;

      buildResMenu();

      function itemProjectClicked (projectID:String){
      _root.m4.loadMovie(projectID);
      }