AS3 Dynamic text bold format

/ Published in: ActionScript 3
Save to your folder(s)

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. }
  9. my_textfield_txt.setTextFormat(boldText);


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.