Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- login.addEventListener(MouseEvent.MOUSE_DOWN, sender);
- function sender(evt:Event) {
- if (tID.text!="" && tPassword.text !="") {
- //for those using PHP
- var loginData:URLRequest = new URLRequest("login3.php");
- //those using ColdFusion should use next line
- //var loginData:URLRequest = new URLRequest("insert.cfm")
- loginData.method = URLRequestMethod.POST;
- var variables:URLVariables = new URLVariables();
- variables.Username = tID.text;
- variables.Password = tPassword.text;
- loginData.data = variables;
- var loader:URLLoader = new URLLoader();
- loader.dataFormat = URLLoaderDataFormat.VARIABLES;
- loader.addEventListener(Event.COMPLETE, dataOnLoad);
- try {
- loader.load(loginData);
- trace("Successfully loaded data!");
- } catch (error:Error) {
- trace("Unable to load URL");
- }
- } else {
- status_txt.text = "Empty Fields!";
- }
- }
- function dataOnLoad(evt:Event) {
- status_txt.text = evt.target.data["writing"];
- if (evt.target.data.writing == "Access granted") {
- status_txt.text = "Access granted!";
- //this.visible = false;
- MovieClip(this.parent).blackOut.gotoAndPlay(2);
- MovieClip(this.parent).blackOut.addEventListener(Event.ENTER_FRAME, entersite);
- } else {
- status_txt.text = "Access denied!";
- }
- }
Add Comment
Please, Sign In to add comment