统计在线人数...

新编A3的菜单

[ 来源:互联网 | 作者:佚名 | 时间:2006-9-1 下午 11:25:20 | 浏览:统计中... ]


有朋友PM偶,发现偶公司网站上的A3菜单代码跟原A3的菜单有所不同,其实是因为原来的菜单无法在Flash2004版本下运行,唯有自己编咯。既然有朋友有兴趣,我也就把他跟大家分享一下吧~ 先看一下效果先~~
点击开新窗口欣赏该FLASH动画![全屏欣赏]
http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width=480 height=260>http://www.flash8.net/bbs/UploadFile/2004-4/2004413104832227.swf
2004的源文件:
点击浏览该文件

MX的源文件:
点击浏览该文件
做法可能有点笨,但很容易理解。毕竟偶之AS的菜菜
这是源代码:

stop(); //这是最重要的一段
targetX = 0;
speedX = 0;
MovieClip.prototype.xMove = function(a, b, tx) { //先定义一个函数先~
var tempx = this._x;
this._x = ((a*(this._x-tx))+(b*(this.prevx-tx)))+tx; //这句主要是产生弹性效果
this.prevx = tempx;

}; //初始化参数
tx1 = 0;
tx2 = 90;
tx3 = 180;
tx4 = 270;
tx5 = 360;
tx6 = 450;
tx7 = 540;
m1.onEnterFrame = function() { //当命名为m1的按钮加载后马上执行函数
this.xMove(1.5, -0.8, tx1);
};
m2.onEnterFrame = function() { //同上~~
this.xMove(1.5, -0.8, tx2);
};
m3.onEnterFrame = function() {//同上~~
this.xMove(1.5, -0.8, tx3);
};
m4.onEnterFrame = function() {//同上~~
this.xMove(1.5, -0.8, tx4);
};
m5.onEnterFrame = function() {//同上~~
this.xMove(1.5, -0.8, tx5);
};
m6.onEnterFrame = function() {//同上~~
this.xMove(1.5, -0.8, tx6);
};
m7.onEnterFrame = function() {//同上~~
this.xMove(1.5, -0.8, tx7);
};
m1.hit.onRollOver = function() { 当鼠标经过按钮时,其他按钮的动作~
m1.gotoAndStop(2);
m2.gotoAndStop(1);
m3.gotoAndStop(1);
m4.gotoAndStop(1);
m5.gotoAndStop(1);
m6.gotoAndStop(1);
m7.gotoAndStop(1);
tx2 = 110; //注意这些参数的变化~~~
tx3 = 200;
tx4 = 290;
tx5 = 380;
tx6 = 470;
tx7 = 560;
};
m2.hit.onRollOver = function() {
m1.gotoAndStop(1);
m2.gotoAndStop(2);
m3.gotoAndStop(1);
m4.gotoAndStop(1);
m5.gotoAndStop(1);
m6.gotoAndStop(1);
m7.gotoAndStop(1);
tx2 = 90;
tx3 = 200;
tx4 = 290;
tx5 = 380;
tx6 = 470;
tx7 = 560;
};
m3.hit.onRollOver = function() {
m1.gotoAndStop(1);
m2.gotoAndStop(1);
m3.gotoAndStop(2);
m4.gotoAndStop(1);
m5.gotoAndStop(1);
m6.gotoAndStop(1);
m7.gotoAndStop(1);
tx2 = 90;
tx3 = 180;
tx4 = 290;
tx5 = 380;
tx6 = 470;
tx7 = 560;
};
m4.hit.onRollOver = function() {
m1.gotoAndStop(1);
m2.gotoAndStop(1);
m3.gotoAndStop(1);
m4.gotoAndStop(2);
m5.gotoAndStop(1);
m6.gotoAndStop(1);
m7.gotoAndStop(1);
tx2 = 90;
tx3 = 180;
tx4 = 270;
tx5 = 380;
tx6 = 470;
tx7 = 560;
};
m5.hit.onRollOver = function() {
m1.gotoAndStop(1);
m2.gotoAndStop(1);
m3.gotoAndStop(1);
m4.gotoAndStop(1);
m5.gotoAndStop(2);
m6.gotoAndStop(1);
m7.gotoAndStop(1);
tx2 = 90;
tx3 = 180;
tx4 = 270;
tx5 = 360;
tx6 = 470;
tx7 = 560;
};
m6.hit.onRollOver = function() {
m1.gotoAndStop(1);
m2.gotoAndStop(1);
m3.gotoAndStop(1);
m4.gotoAndStop(1);
m5.gotoAndStop(1);
m6.gotoAndStop(2);
m7.gotoAndStop(1);
tx2 = 90;
tx3 = 180;
tx4 = 270;
tx5 = 360;
tx6 = 450;
tx7 = 560;
};
m7.hit.onRollOver = function() {
m1.gotoAndStop(1);
m2.gotoAndStop(1);
m3.gotoAndStop(1);
m4.gotoAndStop(1);
m5.gotoAndStop(1);
m6.gotoAndStop(1);
m7.gotoAndStop(2);
tx2 = 90;
tx3 = 180;
tx4 = 270;
tx5 = 360;
tx6 = 450;
tx7 = 540;
};
m1.hit.onRollOut = function() {
m1.gotoAndStop(1);
m2.gotoAndStop(1);
m3.gotoAndStop(1);
m4.gotoAndStop(1);
m5.gotoAndStop(1);
m6.gotoAndStop(1);
m7.gotoAndStop(1);
tx2 = 90;
tx3 = 180;
tx4 = 270;
tx5 = 360;
tx6 = 450;
tx7 = 540;
};
m2.hit.onRollOut = function() {
m1.gotoAndStop(1);
m2.gotoAndStop(1);
m3.gotoAndStop(1);
m4.gotoAndStop(1);
m5.gotoAndStop(1);
m6.gotoAndStop(1);
m7.gotoAndStop(1);
tx2 = 90;
tx3 = 180;
tx4 = 270;
tx5 = 360;
tx6 = 450;
tx7 = 540;
};
m3.hit.onRollOut = function() {
m1.gotoAndStop(1);
m2.gotoAndStop(1);
m3.gotoAndStop(1);
m4.gotoAndStop(1);
m5.gotoAndStop(1);
m6.gotoAndStop(1);
m7.gotoAndStop(1);
tx2 = 90;
tx3 = 180;
tx4 = 270;
tx5 = 360;
tx6 = 450;
tx7 = 540;
};
m4.hit.onRollOut = function() {
m1.gotoAndStop(1);
m2.gotoAndStop(1);
m3.gotoAndStop(1);
m4.gotoAndStop(1);
m5.gotoAndStop(1);
m6.gotoAndStop(1);
m7.gotoAndStop(1);
tx2 = 90;
tx3 = 180;
tx4 = 270;
tx5 = 360;
tx6 = 450;
tx7 = 540;
};
m5.hit.onRollOut = function() {
m1.gotoAndStop(1);
m2.gotoAndStop(1);
m3.gotoAndStop(1);
m4.gotoAndStop(1);
m5.gotoAndStop(1);
m6.gotoAndStop(1);
m7.gotoAndStop(1);
tx2 = 90;
tx3 = 180;
tx4 = 270;
tx5 = 360;
tx6 = 450;
tx7 = 540;
};
m6.hit.onRollOut = function() {
m1.gotoAndStop(1);
m2.gotoAndStop(1);
m3.gotoAndStop(1);
m4.gotoAndStop(1);
m5.gotoAndStop(1);
m6.gotoAndStop(1);
m7.gotoAndStop(1);
tx2 = 90;
tx3 = 180;
tx4 = 270;
tx5 = 360;
tx6 = 450;
tx7 = 540;
};
m1.hit.onRelease = function() { //当按钮被点击释放时,就加载其他MC
loadMovie("v5/about.swf", _root.main_mc);
};
m2.hit.onRelease = function() {
loadMovie("v5/news.swf", _root.main_mc);
};
m3.hit.onRelease = function() {
loadMovie("v5/Portfolio.swf", _root.main_mc);
};
m4.hit.onRelease = function() {
loadMovie("v5/Service.swf", _root.main_mc);
};
m5.hit.onRelease = function() {
loadMovie("v5/Contact.swf", _root.main_mc);
};
m6.hit.onRelease = function() {
loadMovie("v5/gbook/gbook.swf", _root.main_mc);
};
其实这段AS是好简单和容易理解的,只是我把所有AS都写在第一帧上,所以很长~,其实你可以把他们都写到按钮上(不过就要注意一下路径问题了)

共有0人参与评价,平均得分:0分
评论内容只代表网友观点,与本站立场无关! 查看完整内容
   

当前在线人数
QQ:748838 MSN:allen_xia#msn.com E-mail:allenxia666#126.com QQ群:站长联盟北方区-北京(28200145) 站长联盟南方区-上海(67713522)