Sei sulla pagina 1di 2

Actionscript LOGIN BUTTON

stop(); login_btn.buttonMode=true;//show the hand cursor //add event listener login_btn.addEventListener(MouseEvent.CLICK,loginUser) function loginUser(e:MouseEvent):void { //if username & password are correct if(userTxt.text=="upsi" && passTxt.text=="1234") { gotoAndStop("Home"); }

else {//otherwise show an error message var alert:TextFormat= new TextFormat(); alert.color=0xff0000;//red color font feedbackTxt.text="Incorrect Username or Password"; feedbackTxt.setTextFormat(alert); } }

Actionscript BUTTON MENU


Home.addEventListener(MouseEvent.CLICK,clickHome); function clickHome(e:MouseEvent){ trace("Home"); gotoAndStop("Home"); } Product.addEventListener(MouseEvent.CLICK,clickProduct); function clickProduct(e:MouseEvent){ trace("Product"); gotoAndStop("Product"); } Gallery.addEventListener(MouseEvent.CLICK,clickGallery); function clickGallery(e:MouseEvent){ trace("Gallery"); gotoAndStop("Gallery"); } Contect.addEventListener(MouseEvent.CLICK,clickContect); function clickContect(e:MouseEvent){ trace("Contect"); gotoAndStop("Contect"); }

Logout.addEventListener(MouseEvent.CLICK,clickLogout); function clickLogout(e:MouseEvent){ trace("Logout"); gotoAndStop("Login"); }

Potrebbero piacerti anche