Mega Code Archive

 
Categories / Flash ActionScript / TextField
 

The url property allows you to add a hyperlink to text

package{   import flash.display.Sprite;   import flash.text.*;     public class Main extends Sprite{     public function Main(){         var tContent:TextField = new TextField();         tContent.multiline = true;                  tContent.border = true;         tContent.wordWrap = true;         tContent.text = "Visit the Web site";         var tfFormatter:TextFormat = new TextFormat();         tfFormatter.url = "http://thefactoryfactoryfactory.com/wordpress";         tfFormatter.target = "_blank";         tfFormatter.underline = true;         tContent.setTextFormat(tfFormatter,2,5);         addChild(tContent);     }   } }