I'm doing an email interface in FlashMX2004, calling PHP to send the email. My PHP works fine, I can call it from the web, but the feedback from the script isn't being picked up by the Action Script. The PHP returns a value in the following format.
echo 'response=passed';
echo 'response=error';
I'm calling the PHP from the AS with
dataSender.sendAndLoad(" dataReceiver, "POST");
a callback function is define before the sendAndLoad as follows
dataReceiver.onLoad = function()
{
if (this.response == "invalid")
{
_root.gotoAndStop(1);
alert_txt.text = "Please check email address - does not appear valid."
}
else if (this.response == "error")
{
_root.gotoAndStop(3);
}
else if (this.response == "passed")
{
_root.gotoAndStop(4);
}
}
My problem is that the 'this.response' is always coming up as undefined in AS. It looks like the values aren't making it back from the PHP.
I define the two vars at the top of the script
dataSender = new LoadVars();
dataReceiver = new LoadVars();
Does anyone have any idea what I'm doing wrong? Thanks
echo 'response=passed';
echo 'response=error';
I'm calling the PHP from the AS with
dataSender.sendAndLoad(" dataReceiver, "POST");
a callback function is define before the sendAndLoad as follows
dataReceiver.onLoad = function()
{
if (this.response == "invalid")
{
_root.gotoAndStop(1);
alert_txt.text = "Please check email address - does not appear valid."
}
else if (this.response == "error")
{
_root.gotoAndStop(3);
}
else if (this.response == "passed")
{
_root.gotoAndStop(4);
}
}
My problem is that the 'this.response' is always coming up as undefined in AS. It looks like the values aren't making it back from the PHP.
I define the two vars at the top of the script
dataSender = new LoadVars();
dataReceiver = new LoadVars();
Does anyone have any idea what I'm doing wrong? Thanks