Rifts Posted August 31, 2010 Share Posted August 31, 2010 Hey guys, so I have this reg.onPress = function(){ loadVariablesNum("users.php", 0, "POST"); } on my register button which works fine (it enters the data into my database) now i also have a login button login.onPress = function(){ loadVariablesNum("users.php", 0, "POST"); } now with the login how to i "return" if the login was successful or not and if so stopandgoto a new frame? thanks Link to comment https://forums.phpfreaks.com/topic/212131-flash-login-question/ Share on other sites More sharing options...
ricmetal Posted September 14, 2010 Share Posted September 14, 2010 i think all you need to do if check when the variables you called from php have arrived to flash and then you should check them and see what the variables contain. if they contain a success message, then login, else, logout. use onEnterFrame and cehck the names of the variables that come in from php to see if they exist. when they exist, check their content. LoadVars gives you a better control btw to do this.it contains a built in event handler that automatically check when the variables are loaded, so you don't need to setup the onEnterFrame. var myVars:LoadVars = new LoadVars(); myVars.onLoad = function(success:boolean) { //the event handler if(success) { //variables where loaded into flash successfully if(myVars.thePhpVarContainingTheResultOfASuccessfullLogin == "login successfull") { gotoAndStop("login"); }else{ gotoAndStop("logout"); } }else{ trace(the variables where unable to be loaded check the php path and code); } } myVars.load("file.php"); Link to comment https://forums.phpfreaks.com/topic/212131-flash-login-question/#findComment-1110937 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.