zoukankan      html  css  js  c++  java
  • 【AS3代码】创建动态文本

    package
    {
        import flash.display.Sprite;
        import flash.text.TextField;
        import flash.text.TextFieldType;
        
        public class Main extends Sprite
        {    
            public function Main():void
            {
                //创建动态文本
                var txt:TextField = new TextField();
                txt.htmlText = "<b style='font-size:36px'>AS3开发AS3开发AS3开发AS3开发AS3开发</b>";
                txt.y = 100;
                txt.textColor = 0xff0000;            //文字颜色
                txt.background = true;
                txt.backgroundColor = 0x00ff00;
                txt.height=100;
                txt.multiline = true;                //可输入多行
                txt.type = TextFieldType.INPUT;      //文字类型
                txt.wordWrap = true;                 //是否自动换行
                txt.appendText("追加内容");
                this.addChild(txt);
                
                trace(txt.getLineLength(3));         //返回第三行的文本长度
                trace(txt.getLineText(3));           //返回第三行的文本内容
            }
        }
    }
  • 相关阅读:
    [LeetCode] Meeting Rooms I & II
    [LeetCode] Graph Valid Tree
    [LeetCode] Palindrome Permutation I & II
    [LeetCode] Encode and Decode Strings
    [LeetCode] Paint Fence
    android 发送短信功能
    andrioid 分享到其它(短信,qq,微信等功能)
    android Dialog实例
    android开发之onCreate( )方法详解
    android edittext属性说明
  • 原文地址:https://www.cnblogs.com/kingfly/p/2445739.html
Copyright © 2011-2022 走看看