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
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"); }
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.
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"; ?>
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.
Don't see what you're looking for? Try a search.
|