Guest User

Untitled

a guest
Jun 12th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. login.addEventListener(MouseEvent.MOUSE_DOWN, sender);
  2. function sender(evt:Event) {
  3. if (tID.text!="" && tPassword.text !="") {
  4. //for those using PHP
  5. var loginData:URLRequest = new URLRequest("login3.php");
  6. //those using ColdFusion should use next line
  7. //var loginData:URLRequest = new URLRequest("insert.cfm")
  8. loginData.method = URLRequestMethod.POST;
  9. var variables:URLVariables = new URLVariables();
  10. variables.Username = tID.text;
  11. variables.Password = tPassword.text;
  12. loginData.data = variables;
  13. var loader:URLLoader = new URLLoader();
  14. loader.dataFormat = URLLoaderDataFormat.VARIABLES;
  15. loader.addEventListener(Event.COMPLETE, dataOnLoad);
  16. try {
  17. loader.load(loginData);
  18. trace("Successfully loaded data!");
  19. } catch (error:Error) {
  20. trace("Unable to load URL");
  21. }
  22.  
  23. } else {
  24. status_txt.text = "Empty Fields!";
  25. }
  26. }
  27. function dataOnLoad(evt:Event) {
  28. status_txt.text = evt.target.data["writing"];
  29. if (evt.target.data.writing == "Access granted") {
  30. status_txt.text = "Access granted!";
  31. //this.visible = false;
  32. MovieClip(this.parent).blackOut.gotoAndPlay(2);
  33. MovieClip(this.parent).blackOut.addEventListener(Event.ENTER_FRAME, entersite);
  34. } else {
  35. status_txt.text = "Access denied!";
  36. }
  37. }
Add Comment
Please, Sign In to add comment