I’m trying to use an embedded font in a ComboBox component and following the documentation it’s done as my code has it below. However, Macromedia fails to explain what myFormatWhite.font is looking for, as a string. There are SO many places where fonts have labels now, that it’s impossible to know what the heck they’re asking for. Is it the system font name? or the embedded font name? or the ActionScript shared font name? or the library font name? or the InstanceProperty font name? or the label in the embed dialog font name? (I’m probably missing another 3 or 4 if I poke around for places to label fonts) I mean for the love of Christ, how many places can there be to give the same thing yet another (useless) label?
As it stands, my DropDown shows up empty, because obviously I’m not pulling the font in correctly… really wish this was more straight forward… all help appreciated.
var myFormatWhite:TextFormat = new TextFormat();
myFormatWhite.font = "Arial";
myFormatWhite.size = 12;
myFormatWhite.color = 0xFF0000;
tz.textField.setStyle("embedFonts", true);
tz.textField.setStyle("textFormat", myFormatWhite);
Ah! figured it out (yay me!)
Ok… 2 things.
1) the ComboBox itself needs a setStyle call (not just the textField)
so first you have to add this:
And the font name it’s looking for is your generic system font name (not anything you personally have specified in the embed dialog, or in the font export instances). So…
font = "Arial Black"(for example)