1 Reply Latest reply on Oct 27, 2009 6:54 PM by kglad

    Create combo box from another

    frist44

      I currently have a combo box in my movie. The selections are 1, 2, 3,  and 4. I would like to generate another X combo boxes of the same structure based on that number. I.e. Someone choose 2 in ComboBoxA. So 2 of ComboxB's are generated below that.

       

      Can someone help with the syntax?

       

      Thanks,

      Brandon

        • 1. Re: Create combo box from another
          kglad Adobe Community Professional & MVP

          :

           

          import mx.controls.ComboBox;
          var tl:MovieClip = this;
          var lo:Object = new Object();
          lo.close = function(eobj:Object) {
              for (var i = 0; i<eobj.target.selectedItem.label; i++) {
                  var cba:ComboBox = tl.createClassObject(mx.controls.ComboBox,"cb_"+i,i);
                  cba._x = cb._x;
                  cba._y = cb._y+(i+1)*cba._height;
                  cba.dataProvider = [whatever];
              }
          };
          cb.addEventListener("close",lo);