Skip to main content
calmchessplayer
Inspiring
September 9, 2009
Question

LoadVars Woes

  • September 9, 2009
  • 1 reply
  • 1163 views

I have a problem with LoadVars when i execute the code from my server it works fine but when i upload it to the clients server then loadVars stops functioning.....here is my code. Anybody have any ideas why its not working?

application.allowDebug = true;
application.onAppStart = function()
{


}

application.onConnect = function(client) {
trace("fired");
trace("fired");
trace("fired");


this.acceptConnection(client);
    sv0=new LoadVars();
  sv0.filename ="test";
  sv0.onLoad = function(){
    trace(sv0.success);
  };
  sv0.sendAndLoad("http://privatechatnow.com/SampleASP/1e.aspx", sv0, "POST");
}

    This topic has been closed for replies.

    1 reply

    September 9, 2009

    Scope problem perhaps? As you have things now, as soon as the application.onConnect function is done executing, sv0 becomes eligible for garbage collection. Have you tried defining sv0 outside of the onConnect method? (or making it a property of the client object... that would work just as well)

    calmchessplayer
    Inspiring
    September 9, 2009

    well putting it to the client object didn't help is there any server settings that could cause loadVars not to execute? I turned off the firewall without success. Since it works on my FMS but doesn't work on my clients FMS it leads me to believe there is a server or other network issue.what port does loadVars use?

    September 10, 2009

    Http requests all default to port 80.

    Now that I'm looking at your code again, I see that you have the loadvars instance loading into itself. I've never done it that way (not to say it's wrong... I've just never tried that). I typically create two loadvars instances, one as the sender, and one as the result target. Not sure if it makes a difference or not.