Copy link to clipboard
Copied
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
:
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);
Copy link to clipboard
Copied
:
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);