Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Login Script
  2. //This has not been tested and was written off the top of my head - Steven
  3. var username:TextField = new TextField();
  4. var password:TextField = new TextField();
  5. var enterButton:Sprite = new Sprite();
  6. function init(){
  7.     addChild(username);
  8.     username.x = 10;
  9.     username.y = 50;
  10.     addChild(password);
  11.     username.x = 10;
  12.     username.y = 200;
  13.     addChild(enterButton);
  14.     enterButton.x = 10;
  15.     enterButton.y = 350;
  16.     enterButton.graphics.lineStyle(1);
  17.     enterButton.graphics.drawRect(0,0,100,40);
  18.     enterButton.addEventListener(MouseEvent.CLICK, submit);
  19. }
  20. function submit(e:MouseEvent){
  21.     if(username.text == "Michael" && password.text == "Fournier"){
  22.         trace("Login Successful");
  23.         enterButton.removeEventListener(MouseEvent.CLICK, submit);
  24.     }else{
  25.         username.text = "";
  26.         password.text = "";
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement