Customizable ComboBox (Flash CS3)

Here is an example of how to customize the font (size, style, color) for the List and TextField components inside a ComboBox:

First you have to create a TextFormat object where you can specify font, size and color parameters.

var myTextFormat:TextFormat = new TextFormat();
myTextFormat.font = "Comic Sans MS";
myTextFormat.color = 0xFF0000;
myTextFormat.size = 40;

Afterwards you create a new ComboBox and put it on the stage and assign the previous written TextFormat object to the textfield inside the ComboBox, like this:

var myComboBox:ComboBox = new ComboBox();
myComboBox.addItem( { label:"item1" } );
myComboBox.addItem( { label:"item2" } );
myComboBox.textField.setStyle("textFormat", myTextFormat);
//myComboBox.dropdown.setRendererStyle("textFormat", myTextFormat2);
addChild(myComboBox);

Tips: