Specify a target window into which the link opens : htmlText « TextField « Flash / Flex / ActionScript






Specify a target window into which the link opens

 

package {
  import flash.display.Sprite;
  import flash.text.TextField;
  public class Main extends Sprite {
    public function Main(  ) {
        var field:TextField = new TextField(  );
        
        field.text = "Website";
        var formatter:flash.text.TextFormat = new flash.text.TextFormat(  );
        formatter.url = "http://www.java2s.com/";
        formatter.target = "_blank";
        field.setTextFormat(formatter);
    
        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.Set link color
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