Flash AS_初学AS3写了个二级菜单教程源码
代码如下:
menu_mc.sub_s.visible = false;
menu_mc.sub_p.visible = false;
menu_mc.sho_btn.addEventListener(MouseEvent.MOUSE_OVER,shoMouseOver);
menu_mc.sho_btn.addEventListener(MouseEvent.ROLL_OUT,shoRollOut);
function shoMouseOver(e:MouseEvent):void {
menu_mc.sub_s.visible = true;
menu_mc.sub_p.visible = false;
}
function shoRollOut(e:MouseEvent):void {
menu_mc.sub_s.visible = true;
}
menu_mc.pro_btn.addEventListener(MouseEvent.MOUSE_OVER,proMouseOver);
menu_mc.pro_btn.addEventListener(MouseEvent.ROLL_OUT,proRollOut);
function proMouseOver(e:MouseEvent):void {
menu_mc.sub_p.visible = true;
menu_mc.sub_s.visible = false;
}
function proRollOut(e:MouseEvent):void {
menu_mc.sub_p.visible = true;
}
menu_mc.home_btn.addEventListener(MouseEvent.MOUSE_OVER,homeMouseOver);
menu_mc.pro_btn.addEventListener(MouseEvent.ROLL_OUT,homeRollOut);
function homeMouseOver(e:MouseEvent):void {
menu_mc.sub_p.visible = false;
menu_mc.sub_s.visible = false;
}
function homeRollOut(e:MouseEvent):void {
menu_mc.sub_p.visible = false;
}
menu_mc.abo_btn.addEventListener(MouseEvent.MOUSE_OVER,aboMouseOver);
menu_mc.abo_btn.addEventListener(MouseEvent.ROLL_OUT,aboRollOut);
function aboMouseOver(e:MouseEvent):void {
menu_mc.sub_p.visible = false;
menu_mc.sub_s.visible = false;
}
function aboRollOut(e:MouseEvent):void {
menu_mc.sub_p.visible = false;
}
menu_mc.con_btn.addEventListener(MouseEvent.MOUSE_OVER,conMouseOver);
menu_mc.con_btn.addEventListener(MouseEvent.ROLL_OUT,conRollOut);
function conMouseOver(e:MouseEvent):void {
menu_mc.sub_p.visible = false;
menu_mc.sub_s.visible = false;
}
function conRollOut(e:MouseEvent):void {
menu_mc.sub_p.visible = false;
}
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |