-
2006-08-29
简析“网易动感信纸” - [Snug Studio 技巧]
版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
网易动感信纸:查看 例:[FLASH]http://cardimg.163.com/mcards/4/big/3154.swf[/FLASH] 觉得信纸挺好看,下载下来,文件才6KB,但是打开来什么也没有,猜想是使用内嵌Flash的方式。 通过Flash反编译软件,可以分析其结构与代码。 (1)结构 letter.swf ┌───────┐ │ menu.swf │ │┌─────┐┤ ││skin.swf ││ skin_read.swf │└─────┘│ └───────┘ send.swf input.swf question.swf (2)代码分析 2.1 图片、音乐等路径 imgUrl = "http://cardimg.163.com/mcards/"; cgiUrl = "http://cards.163.com/letter/"; musicUrl = "http://cardimg.163.com/cards/mp3/"; 2.2 具体图片、Flash信纸及音乐文件的获取 // 获取音乐 function getMusicUrl(id) { return ((((_level0.musicUrl + getLastNub(id)) + "/") + id) + ".mp3"); } // 获取图片 function getPicUrl(id) { var _local1 = id; if (debug) { return ((((_level0.imgUrl + getLastNub(_local1)) + "/small/") + _local1) + ".jpg"); } return ((((_level0.imgUrl + getLastNub(_local1)) + "/small/s") + _local1) + ".swf"); } // 获取信纸Flash function getSwfUrl(id) { var _local1 = id; var nub = picId[_local1]; return ((((_level0.imgUrl + getLastNub(_local1)) + "/big/") + _local1) + ".swf"); } //以上相关函数,得到ID的最后一个字母 function getLastNub(i) { var _local1 = i; _local1 = "" + _local1; return (_local1.substr(_local1.length - 1, 1)); } 分析以上代码知道,如果ID为3200,则Flash信纸的路径为:http://cardimg.163.com/mcards/0/big/3200.swf。其中“3200”为ID号,“0”为ID的最后一个字母。 2.3 获取Flash信纸的ID号 var url = "http://cards.163.com/letter/xml/"; myXML.load((url + _level0.menuFile) + ".xml"); 由以上二行代码得知,需要一个XML文件,由此得到Flash信纸的相关信息。所以先要获得menuFile: onClipEvent (initialize) { name = "节 日"; file = 302; } 节日:http://cards.163.com/letter/xml/302.xml onClipEvent (initialize) { name = "飞 飞"; file = 299; } 飞飞:http://cards.163.com/letter/xml/299.xml onClipEvent (initialize) { name = "大 话"; file = 298; } 大话:http://cards.163.com/letter/xml/298.xml onClipEvent (initialize) { name = "梦 幻"; file = 297; } 梦幻:http://cards.163.com/letter/xml/297.xml onClipEvent (initialize) { name = "最 新"; file = "new"; } 最新:http://cards.163.com/letter/xml/new.xml onClipEvent (initialize) { name = "祝 福"; file = 285; } 祝福:http://cards.163.com/letter/xml/285.xml onClipEvent (initialize) { name = "生 日"; file = 284; } 生日:http://cards.163.com/letter/xml/284.xml onClipEvent (initialize) { name = "友 情"; file = 283; } 友情:[URL=http://cards.163.com/l
http://zhmwf.yourblog.org/logs/580484.html
随机文章:
设置IE主页 - 利用about 2007-09-22给绿色版迅雷安装插件 2007-07-05清除 soundmix U盘病毒 2007-02-09设备管理器显示空白内容 2006-08-24XP安装过程中SXS.DLL错误 2006-02-07
收藏到:Del.icio.us





