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

Home
Flash / Flex / ActionScript
1.Animation
2.Array
3.Class
4.Data Type
5.Development
6.Function
7.Graphics
8.Language
9.Network
10.Regular Expressions
11.Statement
12.String
13.TextField
14.XML
Flash / Flex / ActionScript » TextField » MouseEvent 




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
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.