Rav4
Relatively simple, but can't get my head around it, being a r****d.
I have a flash form which is using a .php file to send the email.
If that email has been send succesfully, I want it to inform Flash that it did a good job.
Here is my Function for sending the email and what I am trying to get working is handleLoadSuccesfull, but can't.
Obviously have taken other stuff out, but just can't get it working. Any thoughts?
I have a flash form which is using a .php file to send the email.
If that email has been send succesfully, I want it to inform Flash that it did a good job.
Here is my Function for sending the email and what I am trying to get working is handleLoadSuccesfull, but can't.
PHP:
public function sendThisBloodyForm(event:Event)
{
var scriptRequest:URLRequest;
var scriptLoader:URLLoader;
var scriptVars:URLVariables;
var handleLoadSuccessful:Function;
var handleLoadError:Function;
var event:* = event;
handleLoadSuccessful = function (event:Event) : void
{
if (scriptLoader.data.ok)
{
userfield.text = "Form sent!";
}
else
{
userfield.text = "failed on server! ";
}
return;
}// end function
;
handleLoadError = function (event:IOErrorEvent) : void
{
resp.text = "failed! " + event;
return;
}// end function
;
form_subm.mouseEnabled = false;
scriptRequest = new URLRequest("http://domainamecom/send_email.php");
scriptLoader = new URLLoader();
scriptLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
scriptVars = new URLVariables();
scriptLoader.addEventListener(Event.COMPLETE, handleLoadSuccessful);
scriptLoader.addEventListener(IOErrorEvent.IO_ERROR, handleLoadError);
scriptVars.form_1= 1.text;
scriptVars.form_2= 2.text;
scriptVars.form_3= 3.text;
scriptVars.form_4= 4.text;
scriptRequest.method = URLRequestMethod.POST;
scriptRequest.data = scriptVars;
scriptLoader.load(scriptRequest);
return;
}// end function