通行证: 用户 密码 域名空间  下载中心 社区论坛 信息公告 my小屋
联系我们
设为首页
加入收藏

 

qq,asp,php,jsp,xml,sql,.net,编程 程序 网页图象 建站经验 私服
首页 | 新闻资讯 | 编程开发 | 网页设计 | 图形图象 | 网络媒体 | 网站模板 | 数 据 库 | 投稿
论坛 | 操作系统 | 系统优化 | 网络安全 | 黑客技术 | 硬件学堂 | 硬件报价 | 服 务 器 | 地图
专题 | 应用软件 | 聊天通讯 | q q 专栏 | 建站经验 | 在线工具 | 站长club | 注 册 表 | 旧版
社会 | 游戏娱乐 | 设计欣赏 | 疑难解答 | 社区论坛 | 韩国素材 | 素材图库 | 广告服务 | 服务
当前位置:首页>>网络媒体>>flash>>正文 新版上线![旧版]
注:打开慢时请稍等

flash mx 2004 显示外部css和html文件

http://www.iyit.net  日期:2006-5-27 18:52:18  来源:网络转载   点击:
参加讨论

实例 text enhancements

  一、涉及特性

   在实例中,主要涉及在flash mx 2004中引用和显示外部的css文件和html文件。这些都是在flash mx 2004中才有的新特性,应用也非常方便。本实例在flash mx 2004中的操作非常简单,不过这正从侧面反映了它的功能强大。

   二、制作过程

   1、建立一个文件,命名为sample.css。其内容如下:

headline {  font-family: arial,helvetica,sans-serif;  font-size: 16px;  font-weight: bold;  display: block;}subheadline {  font-family: arial,helvetica,sans-serif;  font-size: 13px;  font-weight: bold;  display: block;}mainbody {  font-family: arial,helvetica,sans-serif;  font-size: 10px;  display: block;}biline {  font-family: arial,helvetica,sans-serif;  font-size: 11px;  font-style: italic;  display: inline;}a {  font-family: arial,helvetica,sans-serif;  color:cccccc;  font-size: 10px;  display: inline;  text-decoration:underline;}

  上面的css文件中,中括号里面的是对应的属性。比如font-family是字符集,font-size是字体大小,display是字体的显示方式,等等。只要有简单的网页制作知识就应该可以看懂的。

  2、新建一个文件,命名为sample.html,其内容如下:

<body><headline>giant sea lion spotted</headline><subheadline>citizens scared, amazed</subheadline><biline>today - our city </biline><mainbody>a giant sea lion was spotted today rampaging around the city's main square,scaring thousands of innocent people just out for a daily stroll in the beautiful downtown district.<img align='right' src="http://www.iyit.net/files/beyondpic/2006-5/27/0652718515066357.jpg"/>no injuries were reported after the animal's two-hour assault of the shopping district famous for it's sea lion purses and shoes, also known as the "sea lion district". witnesses said the creature came out of the ocean near the burger king at 42nd and 1st avenue, startling many and stalling traffic. "the animal caused nearly four million dollars of damage to the neighborhood," said joseph valente, owner of "sea lions r' us" at 43rd and 2nd. onlookers to the scene said that the sea lion appeared ornery, but otherwise in good spirits. officials are uncertain as to when, if ever, the sea lion may return.<a href="http://www.macromedia.com">click here for more.</a> </mainbody></body> 

  这个文件的内容是应用了前面所创建的css格式的html文件。(严格来说,此文件更像是一个xml文件。)

  3、将一个名为sample.jpg的图片放到跟第一、二步所创建的文件的同一目录中。

  4、新建一个flash mx 2004的文件,保存在跟前面所创建的文件所在的目录中。

  5、用文本工具在场景中拉一个文本输入框,命名为content。在属性面板上设置如1所示。

  6、在timeline中新建一个图层,命名为action,在此层的action面板上面增加如下语句:

/* copyright 2003 macromedia, inc. all rights reserved.the following is sample code and is subject to all restrictions on such code as contained in the end user license agreement accompanying this product.*/var ss:textfield.stylesheet = new textfield.stylesheet(); //注释1;定义一个变量ss,它的类型为textfield.stylesheet.ss.load("sample.css"); //注释2;读取sample.css文件的内容到ss中。这里要注意所有文件的保存路径要一致.content.stylesheet = ss;//注释3;设置文本框content的几个属性.content.multiline= true;content.wordwrap = true;content.html = true;story = new xml(); //注释4;创建一个xml对象.story.ignorewhite = true;story.load("sample.html"); //注释5;读入sample.html文件的内容到story中.story.onload = function () { //注释6;设置story的onload函数,函数的内容为设置content的htmltext为storycontent.htmltext = story;}

  三、实际用途

  从实例的制作过程中可以看到,以前在flash中一行一行地调整文字显示效果的时候再也不会出现。flash mx 2004中操作html文件非常灵活,修改显示效果也很方便,只要改一下相应的文件内容就可以了。这在用flash来做比较多的文字显示处理的场景中非常有用。


编辑:黑鹰 [发送给好友] [打印本页] [关闭窗口] [返回顶部]
上一篇:flash mx 2004 的历史面板(1)
下一篇:flash mx 2004 新模板应用(2)
转载请注明来源:www.iyit.net
特别声明: 本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。

 相关文章
利用css改善网站可访问性 读取符合rss2.0规范的xml文档 flash中通过xmlsocket监控生产系统(2-5
flash中通过xmlsocket监控生产系统(2-4 flash中通过xmlsocket监控生产系统(2-3 flash中通过xmlsocket监控生产系统(2-2
flash中通过xmlsocket监控生产系统(2-1 flash中通过xmlsocket监控生产系统(1-2 flash中通过xmlsocket监控生产系统(1-1
xml数据库中几个容易混淆的概念2 xml数据库中几个容易混淆的概念1 web设计中如何使用xml数据3
web设计中如何使用xml数据2 web设计中如何使用xml数据1 一个简单的xmlschema的例子
xml在.net平台下的自定义控件的应用(3) xml在.net平台下的自定义控件的应用(2) xml在.net平台下的自定义控件的应用(1)
使用dom创建xml xml文档搜索使用小结2 xml文档搜索使用小结1
xml技术上传文件4 xml技术上传文件3 xml技术上传文件2
最新更新 热点排行 推荐新闻
flash 5.0 功能简介
flash 菜单简要说明(1)
flash 中音频素材的处理
flash shared library 的使用方法(1)
flash 浮动面板使用大全(1)
flash 5.0 功能简介
flash 菜单简要说明(1)
flash 中音频素材的处理
flash shared library 的使用方法(1)
flash 浮动面板使用大全(1)
flash 浮动面板使用大全(2)
flash 鼠标指针
flash 替换外部图片或声音
flash 物体的淡出效果制
flash 引导线的使用
flash常用mc属性控制(1)
flash 神奇遮罩之原理篇(1)
flash mx2004入门与进阶实例——mtv实
flash mx2004入门与进阶实例(1)
flash 神奇遮罩之原理篇(2)
优秀公益广告作品欣赏(8)
java数据类型转换
windows xp专业版iis连接数的更改
新开放qq免费挂级网站
优秀公益广告作品欣赏(7)
免费在qq上看在线电影电视听音乐
office2007简体中文版浮出水面 美图抢
qq最新版下载 2006 beta2 体验新感受 
qq珊瑚虫外挂4.0版本发布!
web服务器配置全攻略(三)
dreamweaver mx 2004从零开始(1)
利用css改善网站可访问性
如何让mm的脸通透可人
msn8.0下载
asp 五大高效提速技巧
如何在win20003中更好的玩游戏
qq收费头像免费使用的方法 
微软将在华推分期付款,充值卡pc 可低价
 amd处理器am2测试 风扇竟运行7分钟
exeplorer.exe错误的问题的总结、解决
 友情链接
设置首 页 - 版权声明 - 广告服务 - 关于我们 - 联系我们 - 友情连接
copyrights © 2004-2006 iyit.net all rights reserved.
网站合作、广告联系qq:147007642、466949678
易特网络技术 点击这里给我发消息