经典FLASH 菜单下载【含源码】
2009-05-22 17:14
489 查看
先简单介绍其中一个菜单,先看效果,
看ACTIONSCRIPT代码,主要菜单的代码:
var drag = 0.4;
var flex = 0.6;
var menuEN = new Array("Home", "Team", "Blog", "Services", "Frenid", "Forums", "Find");
var menuZH = new Array("首页", "团队", "博客", "服务", "朋友", "论坛", "寻人");
var menuURL = new Array("#", "#", "#", "#", "#", "#", "#");
var menuColor = new Array(0xFF6699, 0x00A2FF, 0x96D302, 0xFFC600, 0xFF5400, 0xCD7DE1, 0x02D396);
var mBlock = this.attachMovie("mblock", "mb", 6);
mBlock._y = 5;
mBlock.goalX = -100;
mBlock.onEnterFrame = function() {
this.Step = this.Step*flex+(this.goalX-this.px)*drag;
this.px += this.Step;
this._x = this.px;
if (this.sOut && this._xscale<99.5) {
this._xscale += (100-this._xscale)/8;
}
if (this.sIn && this._xscale>0.1) {
this._xscale += -this._xscale/8;
}
};
var MBColor = new Color(mBlock);
for (var i = 0; i<menuZH.length; i++) {
pipi.start([1, 1]);
var theItem = this.attachMovie("MenuItem", "Item"+i, i+10);
theItem._x = i*84;
theItem.mColor = menuColor[i];
theItem.URL = menuURL[i];
theItem.mc_ZH.itext.text = menuZH[i];
theItem.mc_EN.itext.text = menuEN[i];
theItem.onEnterFrame = function() {
if (this.fadeOut) {
if (this.topLine._alpha<99.5) {
this.topLine._alpha += (100-this.topLine._alpha)/8;
}
if (this.mc_EN._alpha>0.5) {
this.mc_EN._alpha += -this.mc_EN._alpha/0;
}
if (this.mc_ZH._xscale<00) {
this.mc_ZH._xscale += 2;
this.mc_ZH._yscale += 2;
}
}
if (this.fadeIn) {
if (this.mc_EN._alpha<99.5) {
this.mc_EN._alpha += (100-this.mc_EN._alpha)/8;
}
if (this.topLine._alpha>0.5) {
this.topLine._alpha += -this.topLine._alpha/8;
}
if (this.mc_ZH._xscale>100) {
this.mc_ZH._xscale -= 2;
this.mc_ZH._yscale -= 2;
}
}
};
theItem.onRollOver = function() {
mBlock.goalX = this._x+42;
mBlock.sOut = true;
mBlock.sIn = false;
MBColor.setRGB(this.mColor);
new Color(this.topLine).setRGB(this.mColor);
this.fadeOut = true;
this.fadeIn = false;
};
theItem.onRollOut = function() {
mBlock.sOut = false;
mBlock.sIn = true;
this.fadeIn = true;
this.fadeOut = false;
};
theItem.onRelease = function() {
getURL(this.URL);
};
}
stop();
时间的代码:
_root.onEnterFrame = function() {
mydate = new Date();
year = mydate.getFullYear();
month = mydate.getMonth()+1;
date2 = mydate.getDate();
day = mydate.getDay();
hour = mydate.getHours();
minute = mydate.getMinutes();
second = mydate.getSeconds();
if (hour<=12) {
hour = "AM:"+hour;
} else if (hour>12) {
hour = "PM:"+hour;
}
};
由于博客园的上传文件不允许上传扩展名为*.SWF的文件和*.FLA文件,所以还有很FLASH效果没有在此演示,不过没有关系,大伙可以从下面的地址获取到跟多的FLASH菜单的源码:
http://files.cnblogs.com/OceanChen/flashmenu.rar
看ACTIONSCRIPT代码,主要菜单的代码:
var drag = 0.4;
var flex = 0.6;
var menuEN = new Array("Home", "Team", "Blog", "Services", "Frenid", "Forums", "Find");
var menuZH = new Array("首页", "团队", "博客", "服务", "朋友", "论坛", "寻人");
var menuURL = new Array("#", "#", "#", "#", "#", "#", "#");
var menuColor = new Array(0xFF6699, 0x00A2FF, 0x96D302, 0xFFC600, 0xFF5400, 0xCD7DE1, 0x02D396);
var mBlock = this.attachMovie("mblock", "mb", 6);
mBlock._y = 5;
mBlock.goalX = -100;
mBlock.onEnterFrame = function() {
this.Step = this.Step*flex+(this.goalX-this.px)*drag;
this.px += this.Step;
this._x = this.px;
if (this.sOut && this._xscale<99.5) {
this._xscale += (100-this._xscale)/8;
}
if (this.sIn && this._xscale>0.1) {
this._xscale += -this._xscale/8;
}
};
var MBColor = new Color(mBlock);
for (var i = 0; i<menuZH.length; i++) {
pipi.start([1, 1]);
var theItem = this.attachMovie("MenuItem", "Item"+i, i+10);
theItem._x = i*84;
theItem.mColor = menuColor[i];
theItem.URL = menuURL[i];
theItem.mc_ZH.itext.text = menuZH[i];
theItem.mc_EN.itext.text = menuEN[i];
theItem.onEnterFrame = function() {
if (this.fadeOut) {
if (this.topLine._alpha<99.5) {
this.topLine._alpha += (100-this.topLine._alpha)/8;
}
if (this.mc_EN._alpha>0.5) {
this.mc_EN._alpha += -this.mc_EN._alpha/0;
}
if (this.mc_ZH._xscale<00) {
this.mc_ZH._xscale += 2;
this.mc_ZH._yscale += 2;
}
}
if (this.fadeIn) {
if (this.mc_EN._alpha<99.5) {
this.mc_EN._alpha += (100-this.mc_EN._alpha)/8;
}
if (this.topLine._alpha>0.5) {
this.topLine._alpha += -this.topLine._alpha/8;
}
if (this.mc_ZH._xscale>100) {
this.mc_ZH._xscale -= 2;
this.mc_ZH._yscale -= 2;
}
}
};
theItem.onRollOver = function() {
mBlock.goalX = this._x+42;
mBlock.sOut = true;
mBlock.sIn = false;
MBColor.setRGB(this.mColor);
new Color(this.topLine).setRGB(this.mColor);
this.fadeOut = true;
this.fadeIn = false;
};
theItem.onRollOut = function() {
mBlock.sOut = false;
mBlock.sIn = true;
this.fadeIn = true;
this.fadeOut = false;
};
theItem.onRelease = function() {
getURL(this.URL);
};
}
stop();
时间的代码:
_root.onEnterFrame = function() {
mydate = new Date();
year = mydate.getFullYear();
month = mydate.getMonth()+1;
date2 = mydate.getDate();
day = mydate.getDay();
hour = mydate.getHours();
minute = mydate.getMinutes();
second = mydate.getSeconds();
if (hour<=12) {
hour = "AM:"+hour;
} else if (hour>12) {
hour = "PM:"+hour;
}
};
由于博客园的上传文件不允许上传扩展名为*.SWF的文件和*.FLA文件,所以还有很FLASH效果没有在此演示,不过没有关系,大伙可以从下面的地址获取到跟多的FLASH菜单的源码:
http://files.cnblogs.com/OceanChen/flashmenu.rar
相关文章推荐
- jQuery模拟完美实现经典FLASH导航动画效果【附demo源码下载】
- 不依赖Flash和任何JS库实现文本复制与剪切附源码下载
- 无限级联动菜单-AJAX版(附源码下载)
- 跟我一起学extjs5(32--加入模块和菜单定义[4更新菜单(源码下载)])
- 【值得珍藏】2012 PHP热门资料64个+经典源码50个——下载目录
- 怎样学好MFC中各个控件编程或者GDI编程,举例说明和源码下载:比如怎样自绘菜单,按钮,工具条或Tab控件
- MFC/VC++自绘菜单下载源码
- 国外flash as高级程序特效研究探索网站(提供源码下载)
- 80个Python经典资料(教程+源码+工具)汇总――下载目录
- 【开源下载】基于winform的xml菜单编辑器(c#源码)
- Android开发经典源码下载
- 弹性小球flash导航菜单源码
- 80个Python经典资料(教程+源码+工具)汇总——下载目录
- 【J2ME资料汇总】48个推荐资料+40个经典源码——下载目录
- 跟我一起学extjs5(41--增加一个自定义模块(源码下载)[2销售合同加入菜单和模块展示])
- 无限级联动菜单-AJAX版(附源码下载)
- 跟我一起学extjs5(41--增加一个自定义模块(源码下载)[2销售合同加入菜单和模块展示])
- 80个Python经典资料(教程+源码+工具)汇总——下载目录
- js+flash实现的5图变换效果广告代码(附演示与demo源码下载)
- GIS源码下载与GIS经典算法