我的一亩三分地 我就喜欢!
13fen  设为主页
 收藏本站
 
当前位置: > 一亩三分地:首页 > 网络学院 > 图型图像 > FLASH > Flash技巧:SWF图片切换效果
热门文章排行
热门文章排行 Photoshop制作精美的简历封面(10-12)
在Flash课件中正确调用SWF文件(11-25)
巧用Photoshop徒手绘制扇子(10-19)
CorelDRAW12循序渐进-制作文本效果(12-29)
消除文字勾边后产生毛刺的小技巧(06-14)
精采文章排行
精采文章排行 GIF动态图片的修改(11-07)
Q版人物绘制全过程(11-07)
Flash互动电子地图制作手册——入门(11-01)
Flash 8.0前瞻——揭开8 ball的薄面(10-24)
土人AS入门教程对象篇(10-24)
技术专题推荐
网管论坛交流
 

Flash技巧:SWF图片切换效果 

作者:佚名   来源:Linux 宝库   点击:   日期:2006-11-25


-->
SWF定时读取外部图片和新闻标题
类似:http://games.sina.com.cn/ 
简单点,就使用xml+flash,可以直接修改xml
第一帧:

myid_num = new Array();
mytitle_num = new Array();
total = new Array();
System.useCodepage = true;
var myxml = new XML();
myxml.ignoreWhite = true;
myxml.load("date.xml");
myxml.onLoad = function(success) {
 if (success) {
  loader._visible = false;
  parseXML();
 } else {
  trace("XML加载失败!");
 }
};
parseXML = function () {
 total = myxml.firstChild.childNodes[0].childNodes;
 for (i=0; i<total.length; i++) {
  myid_num[i] = total[i].attributes.myid;
  mytitle_num[i] = total[i].attributes.mytitle;
 }
 shownews();
};
shownews = function () {
 for (i=0; i<4; i++) {
  duplicateMovieClip(this.news, "news"+i, i);
  this["news"+i]._x = 13.5;
  this["news"+i]._y += 5+i*23;
  id1 = myid_num[i];
  title1 = mytitle_num[i];
  if (title1.length>=9) {
   title1 = title1.substring(0, 9)+"...";
  }
  // id2 = "0"+id1+".";
  id2 = "※ ";
  title2 = id2+title1;
  this["news"+i].txt = title2;
  this["news"+i].onRelease = function() {
   url1 = "http://football.ppn.cn/tnew.asp?id=";
   id3 = this._name.slice(4);
   id4 = myid_num[id3];
   url2 = url1+id4;
   trace(url2);
   getURL("javascript :MM_openBrWindow("+"’"+url2+"’"+",’_b’,’resizable=no,scrollbars=yes,width=600’)");
  };
 }
};
取名为"date.xml"的文件:

<?xml version=’1.0’ encoding=’UTF-8’?>
<data>
<newsid>
<project myid="1" mytitle="新闻1" />
<project myid="2" mytitle="新闻2" />
<project myid="3" mytitle="新闻3" />
</newsid>
</data>

 




文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【论坛讨论

   相关文章:
·消除文字勾边后产生毛刺的小技巧 · 解决COREDRAW9与双核CPU冲突的技巧 5
·CorelDRAW入门与进阶实例:8.2椭圆按钮制 ·CorelDRAW印前分色新手上路
·IllustratorCS制作刺绣效果 ·CorelDRAW使用技巧-如何在CorelDRAW中虚

   文章评论:(条)
  
 请留名: 匿名评论   点击查看所有评论 网管论坛
 

  责任编辑:一分  声明:刊登此文章是为了传递更多信息,文章内容仅供参考,转载请注明出处。