Hello all, I'm in need of some help.
I'm trying to get my flash website to basically just talk with php.
I actually have it working atm but it's not working how I want it to.
Currently I use the loadVariables() function to send form values to PHP
and then PHP writes the values to a text file formatted for use within flash.
This works but not effectively. Say if more then one user are using the form?!?
Can anyone show me an EFFECTIVE way to communicate back and forth between flash and php? Please keep in mind that this a multiple SWF flash solution. Different segments of the website are loaded in as the user requests them. And almost all the content is competley dynamic and loaded in as requested by the user.
Ideally I'd like to make a single call to PHP file to both send/recieve values.
\/ Alternate way i'm trying without success
Code:
//OnRelease
Path.SubmitBtn_mc.onRelease = function()
{
this.createEmptyMovieClip("target_mc", this.getNextHighestDepth());
loadVariables("http://mysite.com/Pages/PageData/Page3/Forms/form1/request.php", target_mc,"POST");
//Check if we have recieved results back
function checkParamsLoaded()
{
var counter:Number;
if (target_mc.EoF == undefined)
{
if(counter>=20)
{
clearInterval(param_interval);
_global.Result = "Failed to recieve return parameters";
gotoAndPlay("_result");
}
else
{
trace("Not Yet!.");
counter++;
}
}
else
{
trace("Finished Loading. Killing Check.");
trace("-------------");
//List off parameters recieved
for(i in target_mc)
{
trace(i+": "+target_mc[i]);
}
trace("-------------");
clearInterval(param_interval);
//Set Result infomation show user.
_global.Result = target_mc[1];
gotoAndPlay("_result");
}
}
var param_interval:Number = setInterval(checkParamsLoaded, 100);
}
//Stop the movie
stop();
The PHP "ECHOS"(If Success)
Code:
&Result=Successfully sent request&EoF=True
Any help somone can offer is appreciated.