Skip to main content
calmchessplayer
Inspiring
Sep 9, 2009 7:32 PM UTC
Question

LoadVars Woes

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 is closed to new replies. Start a new post to keep the conversation going.

    3 replies

    Sep 9, 2009 8:13 PM UTC

    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)

    Translate
    calmchessplayer
    Inspiring
    Sep 9, 2009 11:44 PM UTC

    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?

    Translate
    Sep 10, 2009 12:57 AM UTC

    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.

    Translate