• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Create combo box from another

Explorer ,
Oct 27, 2009 Oct 27, 2009

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

TOPICS
ActionScript

Views

302

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 27, 2009 Oct 27, 2009

:

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);

Votes

Translate

Translate
Community Expert ,
Oct 27, 2009 Oct 27, 2009

Copy link to clipboard

Copied

LATEST

:

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);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines