闪吧成员
淘沙帮
//================版权声明开始================// //★淘沙网:http://www.taoshaw.com //★淘沙网所有教程欢迎转载。不过请转载时注明出处。谢谢合作。要不然,会打击我的积极性的。嘿嘿。。。。。。 //================版权声明结束================// //固定大小,禁止缩放 fscommand("allowscale", "false"); //创建一个新的空 XML 对象 var my_xml:XML = new XML(); //取消空白节点输出 my_xml.ignoreWhite = true; //加载xml my_xml.load("http://www.taoshaw.com/taoshaw/study/xml_listxiala/List.xml"); //判断是否加载成功,如果成功,则继续前进 my_xml.onLoad = function(ok:Boolean) { if (ok) { xml_Length = my_xml.firstChild.childNodes.length; //读取xml子节点的长度 for (i=0; i<XML_LENGTH; { _root.attachMovie("mc", "mc"+i, i); _root["mc"+i]._y = 100; _root["mc"+i]._x = i*70+110; _root["mc"+i].txt = my_xml.firstChild.childNodes.attributes.nume; //读取菜单名称 } //根据子节点来设置菜单 } else { trace("加载XML失败!"); } }; _root.onMouseDown = function() { for (i=0; i<XML_LENGTH; { xml_Length2 = my_xml.firstChild.childNodes.childNodes.length; if (_root["mc"+i].hitTest(_root._xmouse, _root._ymouse)) { if (my_xml.firstChild.childNodes.hasChildNodes()) { for (j=0; j<XML_LENGTH2; { //调用子菜单元件 _root.attachMovie("xialamc", "xialamc"+i+j, i+j+50); //读取子菜单名称 _root["xialamc"+i+j].subtxt = my_xml.firstChild.childNodes.childNodes[j].attributes.subnume; //设置MC的默认座标 _root["xialamc"+i+j]._x = i*70+168; _root["xialamc"+i+j]._y = j*30+128; } } //否则删除该菜单下的子菜单 } else { for (j=0; j<10; j++) { removeMovieClip(_root["xialamc"+i+j]); } } } //当然K为真时,打开网址 if (k) { getURL(my_urll, _blank); } }; //当鼠标触到菜单时,显示该菜单的子菜单 _root.onMouseMove = function() { k = false; //当鼠标触及菜单时,菜单改变颜色 for (i=0; i<XML_LENGTH; { if (_root["mc"+i].hitTest(_root._xmouse, _root._ymouse)) { _root["mc"+i].gotoAndStop(2); } else { //否则仍旧为默认颜色 _root["mc"+i].gotoAndStop(1); } for (j=0; j<10; j++) { //鼠标触发子菜单时,改变子菜单的颜色 if (_root["xialamc"+i+j].hitTest(_root._xmouse, _root._ymouse)) { _root["xialamc"+i+j].gotoAndStop(11); //读取url值,并赋值给变量“my_urll” my_urll = my_xml.firstChild.childNodes.childNodes[j].attributes.url; //设置k为真 k = true; } else if (_root["xialamc"+i+j]._currentframe != 10 && _root["xialamc"+i+j]._currentframe != 11) { _root["xialamc"+i+j].play(); } else { //将xialamc内时间轴停在第10帧 _root["xialamc"+i+j].gotoAndStop(10); } } } }; //================版权声明开始================// //★淘沙网:http://www.taoshaw.com //★淘沙网所有教程欢迎转载。不过请转载时注明出处。谢谢合作。要不然,会打击我的积极性的。嘿嘿。。。。。。 //================版权声明结束================//
2008-5-19 01:20, 下载次数: 1207
查看个人网站
查看详细资料
TOP
注册会员
新手上路
原帖由 zjluowei 于 2008-5-26 17:37 发表 楼主,我想问个问题,你的下拉菜单的按钮如何可以设置链接到别的帧啊?小弟正遇到这个问题,请教一下. 我的链接到别的帧之后不知道为什么下拉菜单就不会弹出来了.或者那一帧一闪就会没了.请问是什么情况呢? 在线等~~~
官人
高级会员
怡红院大当家