我做的一个
导航条
制作思路是这样的,一张显示所有菜单文字的png图片(要背景透明),
效果放在它的下边,在png图片加放一个透明的mc来加事件,控制
效果的动作。
下载源文件:
http://www.mygamemylove.com/97.html
部分代码:
复制内容到剪贴板
代码:
//www.MyGameMyLove.com 自娱自乐
//更多原创flash源代码,与你分享
//mygamemylove@qq.com
//2007-11-23
for (var i = 1; i<=7; i++) {
_root["mc"+i].i = i;//记录自己的编号,也可以分析自己的_name出来。
_root["mc"+i].onRollOut = function() {
//trace("离开")
//this.i,这个关键,用i的话,会是7,自己思考一下。
_root["mcs"+this.i].gotoAndPlay(7);//gotoAndPlay(7)是因为第6帧有一个stop(),所以前进一个,自己可以测试一下。
};
_root["mc"+i].onRollOver = function() {
//trace("上面")
_root["mcs"+this.i].gotoAndPlay(2);
};
}
//连接
mc1.onRelease = function() {
getURL("index1.html", "_self");
};
mc2.onRelease = function() {
getURL("hdwh.html", "_self");
};
mc3.onRelease = function() {
getURL("fw.html", "_self");
};
mc4.onRelease = function() {
getURL("al.asp", "_self");
};
mc5.onRelease = function() {
getURL("v.asp", "_self");
};
mc6.onRelease = function() {
getURL("tandui.html", "_self");
};
mc7.onRelease = function() {
getURL("lianxi.html", "_self");
};