all groups > flash data integration > december 2006 >
You're in the

flash data integration

group:

Problems with LoadVars.send and Firefox


Problems with LoadVars.send and Firefox 0500053
12/29/2006 3:06:21 PM
flash data integration:
There seems to be a problem with Firefox 2.x sending variables to PHP scripts
with the LoadVars.send/POST method. <br>
The same problem doesn't occur in IE or Opera.
<br>See this url for example to try in both FF and IE/Opera:
http://0500053.info/bugs/.
<br>The source files are http://0500053.info/bugs/loadVars.zip
Any ideas?
g.zelenka@iinet.net.au
Re: Problems with LoadVars.send and Firefox cinemaguy
12/29/2006 8:12:07 PM
Put this code on your Submit button and delete Layer 2

on (release) {
var srLv:LoadVars = new LoadVars();
srLv.onLoad = function() {
aresult.text = parseInt(lVars.val1) + parseInt(lVars.val2);
};
srLv.val1 = val1.text;
srLv.val2 = val2.text;
srLv.sendAndLoad("loadTest.php", "_blank", "POST");
}
Re: Problems with LoadVars.send and Firefox 0500053
12/30/2006 11:09:18 AM
The problem isn't with the 3rd text box receiving the value of the loadVars
-That's just to confirm what the value(val1+val2) should be. The problem is
that the values of the first two boxes aren't being posted to the PHP script
and the server logs show 'Undefined index" for those fields. The blank page
that pops up just hangs and doesn't echo the return values. I've tried
receiving the values back into a result_lv(send and load) and extracting the
values into a text field but the values of the send portion of the command are
never leaving the swf and reaching the server.
Re: Problems with LoadVars.send and Firefox cinemaguy
12/30/2006 4:44:02 PM
Well it looks like it is working fine to me. I made some minor alterations to
your fla and php script which you can see in the code below but the php script
is grabbing the variables from Flash adding them together and then returning
the result back to Flash so that confirms to me that everything is working
correctly.
//
//

Actionscript on Submit btn
on (release) {
var srLv:LoadVars = new LoadVars();
srLv.onLoad = function() {
aresult.text = srLv.fResult;
};
srLv.val1 = val1.text;
srLv.val2 = val2.text;
srLv.sendAndLoad("loadTest.php", srLv, "POST");
}

PHP Script
<?
$val1=$_POST["val1"];
$val2=$_POST["val2"];
$result=$val1+$val2;
echo "fResult=$result";
?>
Re: Problems with LoadVars.send and Firefox 0500053
12/30/2006 8:22:20 PM
Thanks I don't know what's been going on but now everything is working fine
again. The only time it hasn't worked now is when I'm running it from localhost
through my wamp server. It must be the same problem that causes hassles with
mailto links in getUrl scripts from working properly within the local
filesystem. Happy new year.
AddThis Social Bookmark Button