Set link color : htmlText « TextField « Flash / Flex / ActionScript






Set link color

 

package {
  import flash.display.Sprite;
  import flash.text.TextField;
  public class Main extends Sprite {
    public function Main(  ) {
      var field:TextField = new TextField(  );
    
        var htmlLink:String = "<font color='#0000FF'><u>";
        htmlLink += "<a href='http://www.java2s.com'>Website</a>";
        htmlLink += "</u></font>";
        field.htmlText = htmlLink;

        addChild(field);
    }
  }
}

        








Related examples in the same category

1.Displaying HTML-Formatted Text
2.Use html text in TextField
3.Escape HTML tags bracket
4.Add HTML new line tag in TextField
5.Make the text font italic
6.Use HTML hyperlink in TextField
7.Condensing Whitespace
8.Formatting Text by using HTML tags
9.Adding a Hyperlink to Text
10.Add a Hyperlink to Text with target
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