package
{
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.text.TextFieldType;
    import flash.text.TextFormat;        //文字格式类
    
    public class Main extends Sprite
    {    
        public function Main():void
        {
            var format:TextFormat = new TextFormat();
            format.bold = true;
            format.color = 0xff0000;
            format.size = 40;
            format.underline = true;                //带下划线
            format.url = "http://www.baidu.com";
            format.target = "_blank";
            
            var txt:TextField = new TextField();
            txt.text = "AS3开发";
            txt.setTextFormat(format);                //格式绑定下
            txt.width = 300;
            txt.height = 300;
            
            this.addChild(txt);
        }
    }
}

相关文章:

  • 2021-08-14
  • 2022-12-23
  • 2021-07-15
  • 2022-02-07
  • 2021-11-29
  • 2022-12-23
  • 2021-07-05
  • 2021-03-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-01
  • 2022-12-23
  • 2021-07-25
  • 2021-11-29
  • 2021-11-08
相关资源
相似解决方案