views:

501

answers:

1

Is there a way to set a combobox component to multiline in Flash CS4 using actionscript 3 ?

A: 

There's an a way to quickly cheat it and a way to do it properly, depending on your needs and time.

The 'right way' to do it is to make a class that extends CellRenderer in fl.controls.listClasses.* and use that as the combobox's list renderer, that set with styles.

The 'easy way' is to use '\n' to enter a new line, and make the row height larger for the combobox's list:

var dp:DataProvider = new DataProvider();
for(var i:int = 0 ; i  < 10 ; i++){
    dp.addItem({label:'item '+i+' line1\n line2'});
}
cb.dataProvider = dp;
cb.dropdown.rowHeight = 50;

cb stands for combobox.

Goodluck.

George Profenza