1、制作几个图形和电影元件作为显示部件。
2、主场景第一帧上:
//mn布尔开关
varmn=false;
//贮存四个按钮坐标初始值
varpositionm0y=m0._y;
varpositionm1y=m1._y;
varpositionm2y=m2._y;
varpositionm3y=m3._y;
//v移动速度
varv=5;
//设置菜单名称
varmyarraytitle1=newArray("英才学校","语文天地","数学王国","英语世界");
varmyarraytitle2=newArray("高层领导","古典诗歌","逻辑推理","记忆秘诀");
varmyarraytitle3=newArray("教师队伍","现代文学","数学应用","口语场馆");
onEnterFrame=function(){
for(vari=0;i<=3;i++){
//赋值显示菜单名称
_root["m"+i].t.text=myarraytitle1[i];
_root["m"+i].mm.tt.text=myarraytitle2[i];
_root["m"+i].mmm.ttt.text=myarraytitle3[i];
//点灰色小按钮回缩
_root["m"+i].b1.onPress=function(){
this._parent.gotoAndPlay("gogo");
};
//点绿色小按钮回缩
_root["m"+i].b2.onPress=function(){
this._parent.gotoAndPlay("gogo");
};
}
//...........以下为逻辑判断.........
//*****....dan....******如果点击的是m0**********
if(mn=="m0"){
//m0的位置不变;m1、m2、m3向下移动
m0._y=positionm0y;
m1._y=m1._y+v;
m2._y=m2._y+v;
m3._y=m3._y+v;
//m1、m2、m3内部小按钮回缩隐蔽
m1.gotoAndStop("start0");
m2.gotoAndStop("start0");
m3.gotoAndStop("start0");
//m1、m2、m3上右方的三角形返回初始状态
m1.jiao.gotoAndStop("n1");
m2.jiao.gotoAndStop("n1");
m3.jiao.gotoAndStop("n1");
//如果m3到达指定位置,m1、m2、m3停止运动
if(m3._y>=195){
m1._y=136.5;
m2._y=166.5;
m3._y=195.5;
}
//********************************************
//.....以下同上....dan................
}elseif(mn=="m1"){
m1._y=positionm1y;
m2._y=m2._y+v;
m3._y=m3._y+v;
m0.gotoAndStop("start0");
m2.gotoAndStop("start0");
m3.gotoAndStop("start0");
m0.jiao.gotoAndStop("n1");
m2.jiao.gotoAndStop("n1");
m3.jiao.gotoAndStop("n1");
if(m3._y>=194){
m2._y=164.5;
m3._y=194.5;
}
}elseif(mn=="m2"){
m2._y=positionm2y;
m1._y=positionm1y;
m3._y=m3._y+v;
m0.gotoAndStop("start0");
m1.gotoAndStop("start0");
m3.gotoAndStop("start0");
m0.jiao.gotoAndStop("n1");
m1.jiao.gotoAndStop("n1");
m3.jiao.gotoAndStop("n1");
if(m3._y>=194){
m3._y=194.5;
}
}elseif(mn=="m3"){
m1._y=positionm1y;
m2._y=positionm2y;
m3._y=positionm3y;
m0.gotoAndStop("start0");
m1.gotoAndStop("start0");
m2.gotoAndStop("start0");
m0.jiao.gotoAndStop("n1");
m1.jiao.gotoAndStop("n1");
m2.jiao.gotoAndStop("n1");
//.....以上同上....dan................
//~~~~~~~~~~~~~~~~~~~~~如果没有点击任何按钮~~~~~~~~~~~~~~~~~~~
}elseif(!mn){
//m1、m2、m3回到初始位置
m0._y=positionm0y;
m1._y=positionm1y;
m2._y=positionm2y;
m3._y=positionm3y;
//m1、m2、m3内部小按钮回缩隐蔽
m0.gotoAndStop("start0");
m1.gotoAndStop("start0");
m2.gotoAndStop("start0");
m3.gotoAndStop("start0");
}
};