Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MY ACTIONSCRIPT
- //----------------------------------------------------------
- // Log out, and shut down connection
- //----------------------------------------------------------
- function closeConnection()
- {
- smartfox.disconnect()
- gotoAndStop("connect")
- }
- //STEP 3:
- //Go to {code] connect frame:
- var loader:LoadVars = new LoadVars();
- //variable which will load the response from the php file
- var sender:LoadVars = new LoadVars();
- //variable which will send the login info to the php file
- function login() {
- _root.error = "Connecting To The Database";
- if(user.text != ""){
- if(pass.text != ""){
- submit._visible = false;
- sender.user = user.text;
- sender.pass = pass.text;
- sender.sendAndLoad("dbuserconnect.php", loader, "POST");
- //sender.sendAndLoad("Link to your Login PHP file", loader, "POST");
- }else{
- error = "Please enter your password"
- submit._visible = true;
- }
- }else{
- error = "Please enter your username"
- submit._visible = true;
- }
- }
- loader.onLoad = function(success:Boolean) {
- // This boolean variable (success) will return true or false
- // on whether the PHP file was retrieved
- if (success) {
- trace("Recieved php file answer");
- trace("count: "+this.count)
- trace("username: "+this.postuser)
- trace("password: "+this.postpass)
- //checking the answer from the php file
- if (this.check1 == 1)
- {
- error = "Please wait while you are logged in..."
- _root.smartfox.connect(ip, port)
- } else if (this.check1 == 2) {
- error = "The username or password you entered was incorrect"
- submit._visible = true;
- //put here the rest of the code to be executed when the username and pass are wrong
- }
- } else {
- error = "There was a problem connecting to the php file"
- submit._visible = true;
- }
- };
- //loadVariables("dbuserconnect.php", this, "GET")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement