宜昌本地软件开发与弱电工程服务商
项目咨询 · 快速响应
您当前的位置: > 博客2 > AS2与AS3技术

[AS3]as3显示HTML标签文本的代码示例

2016-10-13 00:16:48 点击量:10 标签: 收藏本文

设置htmlText属性值为HTML内容

  1. package {    
  2.     import flash.display.Sprite;    
  3.     import flash.text.TextField;    
  4.     import flash.text.TextFieldType;    
  5.    
  6.     public class Sample0323 extends Sprite    
  7.     {    
  8.         public function Sample0323()    
  9.         {    
  10.             var text:TextField = new TextField();    
  11.             text.type = TextFieldType.INPUT;    
  12.             text.border = true;    
  13.             text.borderColor = 0xFFFF00;    
  14.             text.height = 20;    
  15.                 
  16.             text.htmlText = "<a href='http://www.baidu.com/' target='_blank'><i><u>跳转到百度CuPlayer.com</u></i></a>";    
  17.             text.appendText("CuPlayer.com增加的内容");    
  18.                     
  19.             this.addChild(text);    
  20.         }    
  21.     }    

 

ABOUT US
宜昌农人网络科技有限公司

我们是一家提供综合软件外包与弱电工程服务的技术公司。

业务涵盖定制软件、管理系统、网站、小程序、APP、系统集成、网络布线、监控安防、门禁、机房建设及长期技术维护。

公司地址:湖北省宜昌市伍家岗区东站二路6号三峡(宜昌)大数据产业园海洋馆二楼A203室