actionscript 3 - Setting the font name and size in AS3 List control (flash.controls.List) -
Using CS4, how can I set the list control font? I tried to do this:
var myFormat: TextFormat = new TextFormat (); MyFormat.font = config.settings ["List Font Name"]; MyFormat.size = number (config.settings ["list font size"]); List.setStyle ("textFormat", myFormat);
there is no dice
At the level you can set styles.
For the selection list (list, combo box, tilelist, etc.), you need to use instead of setstyle , because you set the style for each cell renderer / item , And not in the list, if it makes sense:
list.setRendererStyle ('textFormat', myFormat);
In addition to this you can use global styles.
Make sure your fonts are first embedded, then try
import fl.managers .StyleManager; Var myFormat: TextFormat = New TextFormat (config.settings ["List Font Name"], config.settings ["List Font Size"]); StyleManager.setStyle ('embedFonts', true); StyleManager.setStyle ('textFormat', myFormat);
Comments
Post a Comment