Posted By

Winkyboy on 05/27/09


Tagged

text dynamic bold as3 TextFormat bolding


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

enajenkins
edsonpavoni
tspitzr
spowney


AS3 Dynamic text bold format


 / Published in: ActionScript 3
 

URL: http://board.flashkit.com/board/showthread.php?t=180045

A dynamic text field doesn't like to be set to bold (or italic, whatever). You can get around this issue by creating a text format in actionscript and setting that field's format to this newly-created one. This is only good for having a text field where all words in it share the same format (i.e. all words are bold).

  1. var boldText:TextFormat = new TextFormat();
  2. with (boldText) {
  3. //font = "Verdana";
  4. //size = 9.8;
  5. //color = 0x000000;
  6. bold = true;
  7. }
  8.  
  9. my_textfield_txt.setTextFormat(boldText);

Report this snippet  

You need to login to post a comment.