首 页 | 网页模板 | 教程 | 源码下载 | 书籍下载 | 图片素材 | 字体 | JAVA特效 | FLASH源码 | 软件 | 矢量 | 论坛 | 其它 |
设为主页
加入收藏
联系站长
平面设计 | 网页制作 | 程序编写 | 数 据 库 | 媒体动画 | 网络冲浪 | 服务器相关 |
当前在线
广告:P4服务器电信机房6999/年即送产权 | 疾风下载
新编A3的菜单
2004-10-6 6:42:00  作者:模板天下收集整理  来源:未知 网友评论 0 条 论坛
  有朋友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都写在第一帧上,所以很长~,其实你可以把他们都写到按钮上(不过就要注意一下路径问题了)
>> 相关文章
·新编A3的菜单

关于网站 | 客服中心 | 服务条款 | 友情链接 | 广告联系 | 本站历程 | 网站导航

吉ICP备05000107号