|
Telling Flash email sent/failed
Hello
I have the following AS2 script in an FLA file (MX 2004) to send a message from my Flash site to my inbox:
on (release) {
//Import variables to be sent
name = _root.name_txt.text
email = _root.email_txt.text
business = _root.business_txt.text
country = _root.country_txt.text
message = _root.message_txt.text
loadVariables("flash.asp",this,"POST");
//When Flash receives an answer from the server...
this.onData = function() {
//Move to the next frame
_root.nextFrame();
if(this.output=='sent') {
//If successful...
_root.errTitle = 'Thank You.';
_root.errType = "Your message has been succesfully sent.";
}
else
{
//and if not successful...
_root.errTitle = "Error!";
_root.errType = "An error has occurred. Please try again later.";
}
}
}
I hope everything looks right there, but my asp file contains no script to indicate to Flash that the email has been sent. In other words, where I have the following
//When Flash receives an answer from the server...
In the Action Script above, Flash waits for ever to receive an answer. This is probably why my email 'hangs' at the moment after having clicked the contact form's 'submit' button.
What I would like to ask is this:
How do I script a response in ASP which my fla file will understand? Is there a 'standard' response? Or should I use the line from the script above, namely:
if(this.output=='sent')
And what about if the email 'fails'.
Many thanks for any advice.
Steve
|