论坛交流
首页办公自动化| 网页制作| 平面设计| 动画制作| 数据库开发| 程序设计| 全部视频教程
应用视频: Windows | Word2007 | Excel2007 | PowerPoint2007 | Dreamweaver 8 | Fireworks 8 | Flash 8 | Photoshop cs | CorelDraw 12
编程视频: C语言视频教程 | HTML | Div+Css布局 | Javascript | Access数据库 | Asp | Sql Server数据库Asp.net  | Flash AS
当前位置 > 文字教程 > Flash教程
Tag:flash cs,flash 8,鼠绘,as,手绘,工具,文字,loading,入门,初学,mc,影片剪辑,声音,mtv,游戏,引导,遮罩,菜单,补间,广告条,时钟,视频教程

新编A3的菜单

文章类别:Flash | 发表日期:2008-9-21 20:06:16

  有朋友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都写在第一帧上,所以很长~,其实你可以把他们都写到按钮上(不过就要注重一下路径问题了)
上一篇:{实例}flex 以及本人为cctv做的 人气:1541
下一篇:{实例}跑车 人气:1514
视频教程列表
文章教程搜索
 
Flash推荐教程
Flash热门教程
看全部视频教程
购买方式/价格
购买视频教程: 咨询客服
tel:15972130058