as3 formatting a textfield

Posted by duckofrubber on Stack Overflow See other posts from Stack Overflow or by duckofrubber
Published on 2010-04-03T21:03:23Z Indexed on 2010/04/03 21:13 UTC
Read the original article Hit count: 310

Filed under:
|
|
|
|

Hi,

I'm dynamically creating textfields in as3, and formatting them with the TextFormat class. I'm having some issues though with selecting the exact "style" of font to apply to the textfields. My code so far looks like:

   formatT = new TextFormat( );
   formatT.bold = false; 
   formatT.color = 0x000000; 
   formatT.font = "TradeGothic";    
   formatT.size = 16;

    var textItem = new TextField();
    textItem.text = "foobar";
    textItem.setTextFormat(formatT);
    addChild(textItem);

This works ("Trade Gothic" is applied to the enclosed text), however I can't figure out how to apply a specific style of "Trade Gothic", for instance "Light Oblique". Is there some way that I can specify this using the TextFormat class?

Thanks.

© Stack Overflow or respective owner

Related posts about as3

Related posts about flash