flash 加载 html 和CSS

 

flash 加载 html 和CSSAS代码:

场景内添加一个动态文本框名为:loadtxt_css

新建层写入如下代码:

var loadtxt_css:TextField.StyleSheet = new TextField.StyleSheet();

//定义 loadtxt_css 为样式构造函数

loadtxt_css.load("css.css");

//加载预先定义好的 css样式文件

loadtxt.styleSheet = loadtxt_css;

//动态文本框 样式 预设为加载进来的 样式

loadtxt.multiline = true;

//允许多行显示

loadtxt.wordWrap = true;

//支持换行符

loadtxt.html = true;

//支持 html

var loadtxt_html:XML = new XML();

//定义loadtxt_html 为内部xml (用来装载外部文件)

loadtxt_html.ignoreWhite = true;

//忽略空格

loadtxt_html.load("html.html");

//加载html文件

loadtxt_html.onLoad = function()

{

loadtxt.htmlText = loadtxt_html;

//赋予动态文本框 加载进来的html

};

//成功

------------------------------------------------------------------------------------------------------------------------

CSS代码:

与flash文件同文件夹建立一个 css.css 文件:

代码如下:

mainBody {

font-family: "宋体";

color:#666666;

font-size: 12px;

}

biline {

font-family:"宋体";

color:#666666;

font-size: 12px;

font-style: italic;

}

A {

font-family:"宋体";

color:#666666;

font-size: 12px;

display: inline;

text-decoration:underline;

}

a:hover {

font-family: "宋体";

color: #0077D5;

}

.STYLE2 {

color: #333333;

font-family: "宋体";

font-size: 12pt;

}

.STYLE4 {color: #FF3300;}

a:link {

color: #666666;

text-decoration: none;

}

a:visited {

text-decoration: none;

}

------------------------------------------------------------------------------------------------------------------------

html代码:

与flash文件同文件夹建立一个 html.html文件:

代码如下:

<style type="text/css">

</style><body>

<toBody ><span class="STYLE4">热门关键字:</span> <a href="http://www.baidu.com" target="_blank">舞林大会</a> | <a href="http://www.google.com">萨达姆</a> | 雅阁女 | 名声大震 | 蔡依林 | 自拍彩的视频期待您的关注!</toBody >

</body>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值