I'm making a contact form, and I keep getting two errors when I try previewing it in a web browser.
ReferenceError: Error #1065: Variable Button is not defined.
ReferenceError: Error #1065: Variable ComponentShim is not defined.
I don't know what these errors mean. Can anyone give me an explanation? I am using Flash CS4 with ActionScript 3.0. If you need any more information, please let me know. Thanks.
The first function is for the contact button to go to the contact page. The code following is the code for the contact form.
Here is my code for the contact form:
Here is my code for my php file:
ReferenceError: Error #1065: Variable Button is not defined.
ReferenceError: Error #1065: Variable ComponentShim is not defined.
I don't know what these errors mean. Can anyone give me an explanation? I am using Flash CS4 with ActionScript 3.0. If you need any more information, please let me know. Thanks.
The first function is for the contact button to go to the contact page. The code following is the code for the contact form.
Here is my code for the contact form:
Code:
function onContactClick(e:MouseEvent):void
{
gotoAndStop("contact");
}
send_btn.addEventListener(MouseEvent.CLICK, submit);
function submit(e:MouseEvent):void
{
var variables:URLVariables = new URLVariables();
variables.fromname = name_txt.text;
variables.fromemail = email_txt.text;
variables.fromsubject = subject_txt.text;
variables.frommessage = message_txt.text;
var req:URLRequest = new URLRequest("contact.php");
req.data = variables;
req.method = URLRequestMethod.POST;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, sent);
loader.addEventListener(IOErrorEvent.IO_ERROR, error);
loader.load(req);
status_txt.text = "Sending...";
}
function sent(e:Event):void
{
status_txt.text = "Your email has been sent.";
name_txt.text = "";
subject_txt.text = "";
email_txt.text = "";
message_txt.text = "";
}
function error(e:IOErrorEvent):void
{
status_txt.text = "Error - please try again later.";
}
Code:
<?php
$sendto = 'run_for_life@verizon.net';
$name = $_POST['fromname'];
$from = $_POST['fromemail'];
$subject = $_POST['fromsubject'];
$message = $_POST['frommessage'];
$name = stripslashes($name);
$from = stripslashes($from);
$subject = stripslashes($subject);
$message = stripslashes($message);
$data = "Name: " . $name . "\n";
$data .= "Email: " . $from . "\n\n";
$data .= "Subject: " . $subject . "\n\n\n";
$data .= $message;
if(mail($sendto, $data))
{
echo 'response=passed';
}
else
{
echo 'response=failed';
}
?>
Comment