AS3 Dynamic text bold format


/ Published in: ActionScript 3

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).


Copy this code and paste it in your HTML
  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);

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.