大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 网络媒体 -> FLASH -> Flash MX 2004新特性实例学习五

Flash MX 2004新特性实例学习五

时间: 2021-07-31 作者:daque

    范例六、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,其实质如次:   

   giant sea lion spotted

   citizens scared, amazed   

  today - our city 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.

  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.click here for more.   

  这个文献的实质是运用了前方所创造的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.load("sample.css"); //解释2

  content.stylesheet = ss; //解释3

  content.multiline= true;

  content.wordwrap = true;

  content.html = true;   

  story = new xml(); //解释4

  story.ignorewhite = true;

  story.load("sample.html"); //解释5

  story.onload = function () { //解释6

   content.htmltext = story;

  }

      解释1:设置一个变量ss,它的典型为textfield.stylesheet。

    解释2:读取sample.css文献的实质到ss中。这边要提防一切文献的生存路途要普遍。

    解释3:树立文本框content的几个属性。

    解释4:创造一个xml东西。

    解释5:读入sample.html文献的实质到story中。

    解释6:树立story的onload因变量,因变量的实质为树立content的htmltext为story。

  三、本质用处

  从范例的创造进程中不妨看到,往日在flash中一条龙一条龙地安排笔墨表露功效的功夫再也不会展示。flash mx 2004中操纵html文献特殊精巧,窜改表露功效也很简单,只有改一下相映的文献实质就不妨了。这在用flash来做比拟多的笔墨表露处置的场景中特殊有效。

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.