# LoadVars with Server Side ActionScript (Flash Com Server)

**URL:** <https://forum.kirupa.com/t/loadvars-with-server-side-actionscript-flash-com-server/118252>\
**Category:** Uncategorized\
**Created:** [August 4, 2004, 1:19am UTC](https://forum.kirupa.com/t/loadvars-with-server-side-actionscript-flash-com-server/118252 "2004-08-04T01:19:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bergy](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@bergy](https://forum.kirupa.com/u/bergy)\
**Post date:** [August 4, 2004, 1:19am UTC](https://forum.kirupa.com/t/loadvars-with-server-side-actionscript-flash-com-server/118252/1 "2004-08-04T01:19:26Z")

</div>

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:

```auto

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

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 4, 2004, 5:04am UTC](https://forum.kirupa.com/t/loadvars-with-server-side-actionscript-flash-com-server/118252/2 "2004-08-04T05:04:56Z")

</div>

Wouldn’t it be

```auto

my_lv = new LoadVars();

```

?

---

<div class="post-metadata">

**Author:** ![bergy](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@bergy](https://forum.kirupa.com/u/bergy)\
**Post date:** [August 4, 2004, 3:01pm UTC](https://forum.kirupa.com/t/loadvars-with-server-side-actionscript-flash-com-server/118252/3 "2004-08-04T15:01:57Z")

</div>

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???

---

<div class="post-metadata">

**Author:** ![bergy](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@bergy](https://forum.kirupa.com/u/bergy)\
**Post date:** [August 11, 2004, 8:34pm UTC](https://forum.kirupa.com/t/loadvars-with-server-side-actionscript-flash-com-server/118252/4 "2004-08-11T20:34:38Z")

</div>

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:

> **[Amfphp](https://sourceforge.net/projects/amfphp/)**
>
> Download Amfphp for free. Simple Remoting for Web Applications

for more info check out this other discussion on [macromedia.com](http://macromedia.com) that I started:  
[http://www.macromedia.com/cfusion/w...0076&forumid=15](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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 11, 2004, 8:50pm UTC](https://forum.kirupa.com/t/loadvars-with-server-side-actionscript-flash-com-server/118252/5 "2004-08-11T20:50:58Z")

</div>

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

Sorry it took so long for you to find that out

---

<div class="post-metadata">

**Author:** ![bergy](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@bergy](https://forum.kirupa.com/u/bergy)\
**Post date:** [August 11, 2004, 9:32pm UTC](https://forum.kirupa.com/t/loadvars-with-server-side-actionscript-flash-com-server/118252/6 "2004-08-11T21:32:22Z")

</div>

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