Skip to main content
Participant
June 3, 2006
Question

what's the Loadvars.send equivalent of the following getURL?

  • June 3, 2006
  • 2 replies
  • 470 views
getURL (" http://192.168.2.12:8080/4DAction/iTMS_reg.4dp?Job=iTMS&ID=5&Ses=010101010101&Loc=0","_self");

I tried loadvars and send and couldn't get it to work. The getURL works (ie. get the string to my server which uses the Job, ID, etc. variable to store and track info - but it opens a browser which I don't want it to. I've been advised to use loadvars so that the browser doesn't open - and as I mentioned I tried that before getURL and couldn't get it just right.

Would some kind soul post the code for loadvars and send method so I can try again?

Cheers,
Ro.b
This topic has been closed for replies.

2 replies

Participant
June 4, 2006
Blemmo!
You are most excellent and most wise!
The change of "Null" to lv has done it!

Thanks a million.
Be excellent to each other and party on dude!
Inspiring
June 3, 2006
hi,

var lv.LoadVars = new LoadVars();
lv.Job = "iTMS";
lv.ID = 5;
lv.Ses = 010101;
lv.Loc = 0;
lv.sendAndLoad(" http://192.168.2.12:8080/4DAction/iTMS_reg.4dp",null,"GET");

If you don't want a new window open, use sendAndLoad and discard the return. GET appends the objects in lv to the URL like in the getURL line.

hth,
blemmo
Participant
June 3, 2006

Hi Blemmo,

Thanks alot but it didn't work. I tried something just like that before. I did cut and paste your code sample but it still didn't get caught by my web server....will the loadvars.sendandload delimit the data with a leading "?" and the appropriate "&"s between? or should I be including that.

Thanks again,
Rob.
Inspiring
June 4, 2006
Yes, it will send the data in the same format as in getURL, it's both a url encoded GET string. Maybe it's because of the null parameter, try to change that to 'lv'. You can also use onLoad of lv to get info about the sending success:

var lv:LoadVars = new LoadVars();
lv.Job = "iTMS";
lv.ID = 5;
lv.Ses = "010101010101";
lv.Loc = "0";
lv.onLoad = function(success:Boolean) {
if (success) {
trace("data sent");
} else {
trace("error");
}
};
lv.sendAndLoad(" http://192.168.2.12:8080/4DAction/iTMS_reg.4dp", lv, "GET");

If there are any errors, it will trace a message after some seconds.

cheers,
blemmo