Customizable ComboBox (Flash CS3)
Here is an example of how to customize the font (size, style, color) for the two components List and TextField inside the standard ComboBox component:
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:
myComboBox.dropdown.rowHeight = 40;
Related posts:
- Let Flash use WordPress content
Last week I set up a fresh WordPress system for a client to function as a Content Managament System. This... - Flash CS3 Datagrid with AMFPHP
Wade Arnold wrote an interesting article about connecting flash to a MySql database with the help of AMFPHP, flash remoting.... - Importing Cinema4D model into Papervision3D 2.0
Preparing a custom made object in Cinema4D for use in Papervision Flash and importing the exported .dae into flash....