分享
 
 
 

仿韩国菜单as2.0有感

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

我仿韩国菜单,由于其源代码是FlashMx as 1.0编写的,而我采用的是FlashMx2004 as 2.0制作的,故要有点改进。

第一个菜单的源代码

放在main scene frame上

var drag = 0.1; //震动参数

var flex = 0.7; //震动参数

var wordCHArray = new Array("课堂首页","课程介绍","精彩课堂","视频欣赏","电子文档","疑难问答","影视社区");

var wordENArray = new Array("Index","Intro","Course","Video","Document","FAQ","Forum");

var menuColor = new Array(0xFFCC00,0x3399CC,0x96D302,0xFFC600,0xFF5400,0x6699CC,0x02D396); //设置各颜色

var url = new Array("index.htm","#","course/course.htm","#","other/e-learning.htm","#","#");

var block = this.attachMovie("diamond_mc","mb",0); //链接diamond_mc影片

block._x = -1000;

block.Step = 0;

block.px = 0;

block.goalX = -100;

block.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/4;

}

var MBColor=new Color(block);

for (var i:Number = 0; i <= wordCHArray.length-1; i++){

var theItem = this.attachMovie("word_mc","word"+i,i+10); //i+10为深度,必须

theItem._x = i*100;

theItem.wordCH.chn.text = wordCHArray[i];

theItem.wordEN.eng.text = wordENArray[i];

theItem.URL = url[i];

theItem.mColor = menuColor[i];

theItem.onRollOver = function() {

block.goalX = this._x+50;

block.sOut = true;

block.sIn = false;

MBColor.setRGB(this.mColor);

new Color(this.wordCH).setRGB(0xFF9933);

new Color(this.wordEN).setRGB(0xFF9933);

this.wordCH._x -= 5;

this.wordCH._y -= 5;

this.wordEN._x -= 15;

this.fadeOut = true;

this.fadeIn = false;

}

theItem.onRollOut = function() {

block.sOut = false;

block.sIn = true;

this.wordCH._x += 5;

this.wordCH._y += 5;

this.wordEN._x += 15;

new Color(this.wordCH).setRGB(0x499300);

new Color(this.wordEN).setRGB(0x499300);

this.fadeOut = false;

this.fadeIn = true;

}

theItem.onEnterFrame = function(){

if(this.fadeOut){

if(this.wordCH._xscale<130) {this.wordCH._xscale += 5;this.wordCH._yscale += 5;}

}

if(this.fadeIn){

if(this.wordCH._xscale>100) {this.wordCH._xscale -= 5;this.wordCH._yscale -= 5;}

}

}

theItem.onRelease = function() {

getURL(this.URL);

}

}

//禁止右键菜单

fscommand("showmenu", false);

另外一个菜单源代码

放在main scene frame上

stop();

var m_txt = ["第一章","第二章","第三章","第四章","第五章","第六章","第七章"];

var url_txt = ["PC45.JPG","#","#","#","#","#","PC45.JPG"];

var urls = ["#","#","#","#","#","#","#"];

var temp_url = [];

var myB = false;

var l = m_txt.length;

var temp_n = 0;

for (var i = 0; i<l; i++) {

if (i>0) {

this[i+"_mc"]._x = this[(i-1)+"_mc"]._x+this[(i-1)+"_mc"]._width-1.5;

}

this[i+"_mc"].n = i;

this[i+"_mc"].txt.text = m_txt[i];

this[i+"_mc"].ul = url_txt[i];

this[i+"_mc"].onRollOver = function() {

temp_n = this.n;

this.it.loader.contentPath = this.ul;

myB = true;

var j = 0;

this.onEnterFrame = function() {

j += 20;

this.it._alpha = j;

}

}

this[i+"_mc"].onRelease = function(){

temp_url = urls[this.n];

var url = temp_url;

getURL(url);

}

this[i+"_mc"].onRollOut = function() {

temp_n = this.n;

myB = false;

var j = 100;

this.onEnterFrame = function() {

j = j-20;

this.it._alpha = j-1;

}

}

}

//缓冲效果

var speed = 0;

function move_scale(x, obj) {

speed = (x-obj._xscale)*.1+speed*.20;

obj._xscale += speed;

//obj._yscale = obj._xscale;

}

function move_scale2(x,obj){

obj._xscale -= speed;

}

this.onEnterFrame = function() {

for (var i = 0; i<l; i++) {

this[i+"_mc"]._x = this[(i-1)+"_mc"]._x+this[(i-1)+"_mc"]._width-1.5;

this[i+"_mc"]._x = move_scale(100, this[i+"_mc"]);

}

if (myB) {

var s = 100-10/(l-temp_n+1);

move_scale(200, this[temp_n+"_mc"]);

for (var i = temp_n-1; i>0; i--) {

this[i+"_mc"]._x = move_scale(s, this[i+"_mc"]);

}

} else {

for (var i = temp_n+1; i<l; i++) {

this[i+"_mc"]._x = move_scale2(s, this[i+"_mc"]);

}

}

};

//禁止右键菜单

fscommand("showmenu", false);

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有