package { import flash.display.MovieClip; import flash.text.*; import flash.events.*; import flash.display.Sprite; public class tleLogin extends MovieClip { loginButton.addEventListener (MouseEvent.CLICK, onLoginClicked); function loginValidation (e:Event) { var theUser = userName.text; var thePass = passWord.text; var theError = errorText.text; if (theUser == "") { trace("The Username TextField is Empty."); stop(1); theError = "Please enter a Username."; } else if (thePass == "") { trace("The Password TextField is Empty."); stop(1); theError = "Please enter a Password."; } else if (theUser == "" && thePass == "") { trace("The Username & Password TextField is Empty"); stop(1); theError = "Please enter a Username & Password"; } else { trace("Credentials were correctly entered"); onLoginClicked(); } registerButton.addEventListener (MouseEvent.CLICK, onRegisterClicked); function onRegisterClicked (evt:MouseEvent) { gotoAndStop(3); function onLoginClicked (evt:MouseEvent) { function loginValidation(); trace("Login was Clicked & Validated Correctly"); gotoAndStop(2); } } } } }