bergy
August 3rd, 2004, 09:19 PM
I'm making a simple login application. I want to send a username/password while connecting to FCS, and have the SSAS of main.asc connect to a PHP document that will lookup the username/pass and make the necessary checks for the information in a mySQL database.
I'm trying to use the LoadVars() object, maybe you can't do this with SSAS? Or maybe i need to include some other actionscript file (I know when you use components you have to specify load("components.asc"); at the top of the main.asc file --- i'm hoping it's something that easy :))
This is my first FCS app, I've done a lot of research but this one's sort of stumping me. I keep getting an error that looks like this:
/opt/macromedia/fcs/applications/my_app/main.asc: line 9: ReferenceError: LoadVars is not defined
Here is my code for main.asc:
application.onAppStart = function(){
this.userCount = 0;
this.users = [];
}
application.onConnect = function(thisClient, username, password){
thisClient.username = username;
//authentication functions
var my_lv:LoadVars = new LoadVars; //line 9 where error happens
my_lv.load("http://10.10.1.200/_websites/quickconnect/verify.php?username="+escape(username)+"&password="+escape(password));
my_lv.onLoad = function(success){
if(success == true){
thisClient.username = my_lv.username;
thisClient.email = my_lv.email;
thisClient.firstname = my_lv.firstname;
thisClient.lastname = my_lv.lastname;
thisClient.usertype = my_lv.usertype;
this.users[this.userCount] = thisClient;
this.userCount++;
}
}
//if login is okay
//add user to users list
this.acceptConnection(thisClient);
}
I'm trying to use the LoadVars() object, maybe you can't do this with SSAS? Or maybe i need to include some other actionscript file (I know when you use components you have to specify load("components.asc"); at the top of the main.asc file --- i'm hoping it's something that easy :))
This is my first FCS app, I've done a lot of research but this one's sort of stumping me. I keep getting an error that looks like this:
/opt/macromedia/fcs/applications/my_app/main.asc: line 9: ReferenceError: LoadVars is not defined
Here is my code for main.asc:
application.onAppStart = function(){
this.userCount = 0;
this.users = [];
}
application.onConnect = function(thisClient, username, password){
thisClient.username = username;
//authentication functions
var my_lv:LoadVars = new LoadVars; //line 9 where error happens
my_lv.load("http://10.10.1.200/_websites/quickconnect/verify.php?username="+escape(username)+"&password="+escape(password));
my_lv.onLoad = function(success){
if(success == true){
thisClient.username = my_lv.username;
thisClient.email = my_lv.email;
thisClient.firstname = my_lv.firstname;
thisClient.lastname = my_lv.lastname;
thisClient.usertype = my_lv.usertype;
this.users[this.userCount] = thisClient;
this.userCount++;
}
}
//if login is okay
//add user to users list
this.acceptConnection(thisClient);
}