메뉴 메뉴 감청 설정

1937 단어 menu
        //  menu 			

		public  function addMenuListener(selectedBtn:String):void{

			

			for(var i:int = 1;i< 5;i++){				

				if( this.menu["menuBtn"+i] !=  null){									 

				   this.menu["menuBtn"+i].buttonMode = true;														

				   this.menu["menuBtn"+i].mouseChildren = false;														

				   this.menu["menuBtn"+i].mouseEnabled = true;														

				   this.menu["menuBtn"+i].gotoAndStop(1);																       

				   this.menu["menuBtn"+i].addEventListener(MouseEvent.CLICK, onMenuBtnClick);				

				   this.menu["menuBtn"+i].addEventListener(MouseEvent.ROLL_OVER, onMenuBtnMouseOver);				

				   this.menu["menuBtn"+i].addEventListener(MouseEvent.ROLL_OUT, onMenuBtnMouseOut);								   				   

				}else{

					trace(" !");

				}

			}							

			// 				   

			this.menu[selectedBtn].removeEventListener(MouseEvent.CLICK, onMenuBtnClick);				

			this.menu[selectedBtn].removeEventListener(MouseEvent.ROLL_OVER, onMenuBtnMouseOver);				

			this.menu[selectedBtn].removeEventListener(MouseEvent.ROLL_OUT, onMenuBtnMouseOut);												   

			this.menu[selectedBtn].gotoAndStop(10);																				

			

		}		

		//        

		private function onMenuBtnMouseOver(event:MouseEvent):void {										

			event.currentTarget.gotoAndPlay(2);															

		}

		//        

		private function onMenuBtnMouseOut(event:MouseEvent):void {					

			event.currentTarget.gotoAndStop(1);												

		}		

		//    panel

		private function onMenuBtnClick(event:MouseEvent):void {           

			//  btn     arr 

		  	//var btnNum:int = event.currentTarget.name.charAt(3);								

			trace(" :"+event.currentTarget.name);			

			

			addMenuListener(event.currentTarget.name);		

			

			

			/*if(event.currentTarget.name == "menuBtn1"){

				

				

			}*/

			

		}


좋은 웹페이지 즐겨찾기