Displaying HTML-Formatted Text : htmlText « TextField « Flash / Flex / ActionScript






Displaying HTML-Formatted Text

 

package {

  import flash.display.Sprite;
  import flash.text.TextField;
  public class Main extends Sprite {
    public function Main(  ) {
      var field:TextField = new TextField(  );
    
        field.htmlText = "<u>This displays as underlined text.</u>";
        
        field.text = "<u>underlined text</u>";  addChild(field);
    }
  }
}

        








Related examples in the same category

1.Use html text in TextField
2.Escape HTML tags bracket
3.Add HTML new line tag in TextField
4.Make the text font italic
5.Use HTML hyperlink in TextField
6.Condensing Whitespace
7.Formatting Text by using HTML tags
8.Adding a Hyperlink to Text
9.Add a Hyperlink to Text with target
10.Set link color
11.Specify a target window into which the link opens
12.Formatting Text with HTML
13.Use HTML to make the text bold
14.Quoting attribute values
15.Interactions between the text and htmlText variables
16.Set both text and htmlText
17.Adding Mail Links
18.Calling JavaScript Functions
19.Embedding Content in Text
20.Use img tag in TextField
21.Embed a SWF file