Personal and Professional Blog of Rich Hauck

Flash CS3 ComboBox setStyle() for Text

by: Rich Hauck

I’ve been delving into Flash’s CS3 components and discovered that the typical Actionscript 3.0 setStyle() method doesn’t work with the ComboBox. The workaround is to set the styles for components within the ComboBox. Here’s an example:

var tf:TextFormat = new TextFormat();

tf.color = 0xFFFFFF;

myComboBox.dropdown.setRendererStyle("textFormat", tf);

// specify "disabledTextFormat" to overwrite default
myComboBox.textField.setStyle("disabledTextFormat", tf);

Happy coding!

Categories:ActionScript Flash

7 thoughts on “Flash CS3 ComboBox setStyle() for Text

  1. Roland says:

    Hi. Greetings from Singapore. Thanks for the combobox setstyle info! Been searching for hours on net trying to figure out the solution. Adobe documentation not clear and dont work . Come across your site by chance while googling..

  2. Rich Hauck says:

    Glad I could help.

  3. ojorus says:

    Thanks a LOT for this! After hours of searching, this code did it!!

  4. sooty says:

    Thank you, pounding my head against the wall for several hours. The supporting documentation for Adobe is so lacking. Oh well bring on CS4

  5. Tim Harris says:

    Once again, Flash bloggers save my ass. Adobe Flash needs to fix this crap more so than shoving them under the rug. I’m going to add your RSS feed to my website. GREAT FIND !

  6. […] when the class file is called again. What’s the freakin beef ? It’s a Flash bug. And my friend at Mandaia TV has the solution. Enjoy […]

  7. zuby says:

    Love u…………………..

Leave a Reply

Your email address will not be published. Required fields are marked *

About Rich Hauck

Rich Hauck

I'm a creative technologist at Hauck Interactive, Inc. and an adjunct instructor at HACC. I live in Harrisburg, Pa. with my wife and three boys. I enjoy good coffee, Trappist beers, Orioles baseball, and good design.