Skip to main content
January 15, 2007
Question

Prototypes won't load variables?

  • January 15, 2007
  • 1 reply
  • 275 views
I am using FMS2 to work as a buffer inbetween my PHP Code and my Flash Client.

The thing is, my client worked flawlessly when using PHP/MySQL and Flash alone, but when integrating FMS, I encountered a few problems. It seems like when using a prototype function or onDisconnect and trying to use LoadVars() and retrieve the information the PHP file outputs, FMS returns undefined.

We tried using sendAndLoad but encounter the same errors.

Do you get what I am saying, or do you need more explanation, if you do, could you please help/explain.


Heres a better example:

quote:

Client.prototype.fncload = function(usernumber)
{
returninfo = new LoadVars();
returninfo.load(" http://serverip/getinfo.php?unum=usernumber");
returninfo.onLoad = function()
{
trace(returninfo);
//returns undefined, undefined, undefined
}
}


This is inside an ASC file.
    This topic has been closed for replies.

    1 reply

    January 15, 2007
    Looks like the loadVars is working... but your variable data isn't getting sent to the php script because of a syntax error in your code. You need to use the + operator if you're adding a var in a string

    Client.prototype.fncload = function(usernumber){
    returninfo = new LoadVars();
    returninfo.onLoad = function(){
    trace(this.toString());
    }
    returninfo.load(" http://servrip/getinfo.php?unum="+usernumber);
    }