Blkhwks19
01-10-2008, 03:33 PM
I have a ComboBox component that Id like to customize. Basically all Id like to do is apply certain changes, like make the selection highlight color different, make all the text color different, etc. Then Id like to take it one step further and format each individual row separately so one row can be bold, one row can be italicized, etc.
Ive found sound code in Flash Help that looks like it SHOULD work but in my experience it only seems to partially work. Heres what I found ("navmenu" is the instance name of my ComboBox):
These lines set the corresponding properties for every item in the list of the ComboBox. That works great!
navmenu.setStyle("themeColor", "haloBlue");
navmenu.setStyle("fontFamily", "Arial");
navmenu.setStyle("color", "0x000000");
navmenu.setStyle("fontSize", "12");
Now this line is supposed to set the properties of an individual row of the list, but as far as I can tell only the "backgroundColor" property is the one that actually seems to work.
navmenu.dropdown.setPropertiesAt(3, {backgroundColor:0xFF0000, color:0x0000FF, textIndent:3, fontStyle:italic});
For example this is suppsoed to make the 3rd elemtn in the list (which is actually the 4th row since it starts with 0, not 1) have blue text on a red background, indent it 3, and make the text italic. The properties "color", "textIndent", "fontStyle", as well as a few others dont seem to have any effect.
Am I formatting the commands improperly, or am I just simply approaching the entire situation wrong? Can anyone help me figure out why this isnt working as Flash help indicates it should? Many thanks in advance!
Ive found sound code in Flash Help that looks like it SHOULD work but in my experience it only seems to partially work. Heres what I found ("navmenu" is the instance name of my ComboBox):
These lines set the corresponding properties for every item in the list of the ComboBox. That works great!
navmenu.setStyle("themeColor", "haloBlue");
navmenu.setStyle("fontFamily", "Arial");
navmenu.setStyle("color", "0x000000");
navmenu.setStyle("fontSize", "12");
Now this line is supposed to set the properties of an individual row of the list, but as far as I can tell only the "backgroundColor" property is the one that actually seems to work.
navmenu.dropdown.setPropertiesAt(3, {backgroundColor:0xFF0000, color:0x0000FF, textIndent:3, fontStyle:italic});
For example this is suppsoed to make the 3rd elemtn in the list (which is actually the 4th row since it starts with 0, not 1) have blue text on a red background, indent it 3, and make the text italic. The properties "color", "textIndent", "fontStyle", as well as a few others dont seem to have any effect.
Am I formatting the commands improperly, or am I just simply approaching the entire situation wrong? Can anyone help me figure out why this isnt working as Flash help indicates it should? Many thanks in advance!