LoadVars with Server Side ActionScript (Flash Com Server)

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);	
}

Wouldn’t it be


my_lv = new LoadVars();

?

No, I tried that, the reason why I have my_lv:LoadVars = new LoadVars; is because I tried it the other ways…

my_lv = new LoadVars();
var my_lv:LoadVars(); and everything in between (I did forget the () at the end of my statement in the post, but i saw that and tried it w/ the () and it still gives me the error. It’s saying the object LoadVars is undefined, meaning server side action script doesn’t support the LoadVars object, I’m trying to figure out if there is a way to make it support the object???

I have found the solution to my problem and that is that there is no solution! Actionscript 2.0 is NOT supported with Flash Communication Server MX’s version of actionscript (SSAS) rendering the LoadVars(); object unusable.

All of that type of stuff has to be done within the client SWF or by using a gateway to interface directly with the server. Coldfusion is capable of this, and there is an open source PHP version called AMFphp.

Downloadable here:

for more info check out this other discussion on macromedia.com that I started:
http://www.macromedia.com/cfusion/w...0076&forumid=15

I hope this helps people like me, because i searched forums and web pages for hours on this subject with no luck. At least when searching forums, SASS and LoadVars() together will result in something now

Wow, that sucks, I didn’t answer your previous post because basically I didn’t have any info for ya :frowning:

Sorry it took so long for you to find that out

hehehe no prob digi :slight_smile: i actually should have just dug a little deeper in the technotes for FCS and i would have been fine :wink: