Here's a wierd one

Hi guys,

I had a wierd one and I’m not sure if anyone else has come across this - or if I’m just being a muppet.

I wanted to send some variables to a php file. Easy enough

var lv:LoadVars = new LoadVars();

lv.dataOne = “Data one”;
lv.dataTwo = “Data two”;

lv.send (“myfile.php”);

It didn’t work.

I tried a few different variations and then thought, lets do a send an load for testing.

var lv:LoadVars = new LoadVars();
var test:LoadVars = new LoadVars();

lv.dataOne = “Data one”;
lv.dataTwo = “Data two”;

lv.sendAndLoad (“myfile.php”,test);

test.onload = function () {

      trace ("It's finally worked!!!!");

}

Ran it, got the trace and also it hit the php. So why on earth did sendAndLoad work, and not just send? I believed that leaving send with only the file to hit would POST the variables to it? Or for send to work do you HAVE to define a window to open?

I’ve only ever had this situation where I was sending variables only without waiting for a response so I’ve always used sendAndLoad up to now.

As it’s working now it’s not desperately pressing, but I have to confess I’m a bit stumped.