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每天一题】Combinations(组合)
    【算法】字符串匹配算法
    【LeetCode每天一题】Edit Distance(编辑距离)
    【LeetCode每天一题】Set Matrix Zeroes(设置0矩阵)
    SpringIOC和DI
    SpringMVC基础
    SpringMVC框架简介
    Spring配置JDBCTemplate
    java自定义注解
    KTV项目之3个ListView的跳转和加载歌手图片
  • 原文地址:https://www.cnblogs.com/kingfly/p/2445739.html
Copyright © 2011-2022 走看看