as3 ComboBox Font embedding problem Flash CS5
Font embedding in combobox component problem hit me this morning when I tried to debug my old project. I Googled and found solution for font embed problem in combobox -actionscript code.
For the projects that need to change the font style of combobox component in flash to merge with the design well.
Here I am not going to explain the as3-flash font embedding
Follow the steps to embed font in flash combobox component:
1. Open Component panel, Window ->Components or CNTL+f7
2. Drag a ComboBox Component on Stage and name it as myComboBox
3. Follow this link to know how to create as3 font embedding in flash.
4. Remember the FontName, paste the code below in first frame.
var arial:Font = new ArialFont();
var myFormatBlack:TextFormat = new TextFormat();
myFormatBlack.font = arial.fontName;
myFormatBlack.size = 18;
myFormatBlack.color = 0x000000;
myComboBox.textField.setStyle("embedFonts", true);
myComboBox.textField.setStyle("textFormat", myFormatBlack);
myComboBox.dropdown.setRendererStyle("embedFonts", true);
myComboBox.dropdown.setRendererStyle("textFormat", myFormatBlack);
myComboBox.setStyle("embedFonts", true);
myComboBox.setStyle("textFormat", myFormatBlack);
myComboBox.prompt = "Select State";
myComboBox.width = 248;
myComboBox.height = 25;
myComboBox.x = 100
myComboBox.y = 100
myComboBox.setStyle("textPadding", 1);
5. With the source file, I have added code to apply dataProvider to comboBox as3
Conclusion: In this article we have seen how to use combo box in flash actionscript and solution of how to embed font in flash using actionscript 3 (as3).
| 







![[Google]](http://www.designscripting.com/wp-content/plugins/easy-adsenser/google-dark.gif)