11RIA 闪客社区 - 最赞 Animate Flash 论坛

搜索
查看: 3116|回复: 3
上一主题 下一主题

[扩展软件] flash的html工具

[复制链接] TA的其它主题
发表于 2017-11-9 09:10:51 | 显示全部楼层 |阅读模式

【游客模式】——注册会员,加入11RIA 闪客社区吧!一起见证Flash的再次辉煌……

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
本帖最后由 TKCB 于 2017-11-14 23:32 编辑

package me.rainssong.text
{

    public class HtmlText extends Object
    {
        public static const WHITE:uint = 0xffffff;
        public static const SILVER:uint = 0xc0c0c0;
        public static const GRAY:uint = 0x808080;
        public static const BLACK:uint = 0x000000;
        public static const RED:uint = 0xff0000;
        public static const MAROON:uint = 0x800000;
        public static const YELLOW:uint = 0xffff00;
        public static const OLIVE:uint = 0x808000;
        public static const LIME:uint = 0x00ff00;
        public static const GREEN:uint = 0x008000;
        public static const AQUA:uint = 0x00ffff;
        public static const TEAL:uint = 0x008080;
        public static const BLUE:uint = 0x0000ff;
        public static const NAVY:uint = 0x000080;
        public static const FUCHSIA:uint = 0xff00ff;
        public static const PURPLE:uint = 0x800080;
        static public const ORANGE:uint = 0xFF7F00;

        public function HtmlText()
        {
            return;
        } // end function

        public static function yellow(content:String):String
        {
            return format(content, YELLOW);
        } // end function

        public static function red(content:String):String
        {
            return format(content, RED);
        } // end function

        public static function white(content:String):String
        {
            return format(content, WHITE);
        } // end function

        public static function green(content:String):String
        {
            return format(content, GREEN);
        } // end function

        public static function blue(content:String):String
        {
            return format(content, BLUE);
        } // end function

        public static function orange(content:String):String
        {
            return format(content, ORANGE);
        } // end function

        /**
         *
         * @param content
         * @param params  bold:Boolean  italic:Boolean underline:Boolean font:String=null size:int  color:uint href:String align:String="left"/"center"/"right"
         *
         * @return htmlText
         */
        public static function format(content:String, params:Object = null):String
        {
            if (!params)
                return content;
            if (params.bold)
            {
                content = "<b>" + content + "</b>";
            } // end if
            if (params.italic)
            {
                content = "<i>" + content + "</i>";
            } // end if
            if (params.underline)
            {
                content = "<u>" + content + "</u>";
            } // end if
            var config:String = "";
            if (params.font)
            {
                config = config + (" font=\"" +params.font + "\"");
            } // end if
            if (params.size)
            {
                config = config + (" size=\"" + params.size + "\"");
            } // end if
            if (params.color)
            {
                config = config + (" color=\"#" + params.color.toString(16) + "\"");
            }
            content = "<font" + config + ">" + content + "</font>";
            if (params.href)
            {
                content = "<a href=\"" + params.href + "\" target=\"_blank\">" + content + "</a>";
            } // end if
            if (params.align)
            {
                content = "<p align=\"" + params.align + "\">" + content + "</p>";
            } // end if
            return content;
        } // end function

    }
}
发表于 2017-11-14 23:32:47 | 显示全部楼层
发了一堆代码~~一个演示demo图片都没有~~,一个字都不说~~看不懂
回复

使用道具 举报

发表于 2018-12-1 13:30:55 | 显示全部楼层
我也看不懂
回复

使用道具 举报

发表于 2019-4-11 09:18:13 | 显示全部楼层
看着好像设定文本格式的而已
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

感谢所有支持论坛的朋友:下面展示最新的5位赞助和充值的朋友……更多赞助和充值朋友的信息,请查看:永远的感谢名单

SGlW(66139)、 anghuo(841)、 whdsyes(255)、 longxia(60904)、 囫囵吞澡(58054)

下面展示总排行榜的前3名(T1-T3)和今年排行榜的前3名的朋友(C1-C3)……更多信息,请查看:总排行榜今年排行榜

T1. fhqu1462(969)、 T2. lwlpluto(14232)、 T3. 1367926921(962)  |  C1. anghuo(147)、 C2. fdisker(27945)、 C3. 囫囵吞澡(58054)



快速回复 返回顶部 返回列表