Clickable TextField : MouseEvent « TextField « Flash / Flex / ActionScript






Clickable TextField

 
package{
    import flash.display.GradientType;
    import flash.display.Sprite;
    import flash.geom.Matrix;
    import flash.text.TextField;     
    
    
    public class Main extends Sprite {
    
         public function Main() {
            var head:ClickableHeading = new ClickableHeading("ActionScript","http://www.java2s.com");
            addChild(head);
         }
    
    }
}
class ClickableHeading extends flash.text.TextField {
    public function ClickableHeading (headText:String, URL:String) {
      //this.html = true;
      //autoSize = TextFieldAutoSize.LEFT;
      htmlText = "<a href='" + URL + "'>" + headText + "</a>";
      border = true;
      background = true;
    }
  }

        








Related examples in the same category

1.Add mouse click listener to TextField
2.Disappearing TextField
3.Working with Advanced Text Layout
4.Highlight a paragraph when the user clicks a character
5.Drag and drop text
6.To remove the highlight when the mouse moves away from both text fields, we would first register both text fields to receive the MouseEvent.MOUSE_OUT event
7.Using multiLine and TextMetrics: set the characters in the line underneath the user's mouse to red.
8.Unicode characters