sunarm_jk 发表于 2017-11-9 09:10:51

flash的html工具

本帖最后由 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 paramsbold:Booleanitalic:Boolean underline:Boolean font:String=null size:intcolor: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

    }
}

TKCB 发表于 2017-11-14 23:32:47

发了一堆代码~~一个演示demo图片都没有~~,一个字都不说~~看不懂

每天进帐500万 发表于 2018-12-1 13:30:55

我也看不懂

cdt 发表于 2019-4-11 09:18:13

看着好像设定文本格式的而已
页: [1]
查看完整版本: flash的html工具

感谢所有支持论坛的朋友:下面展示最新的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)