Connecting Tech Pros Worldwide Help | Site Map

Variable Button is not defined?

  #1  
Old July 3rd, 2009, 10:44 PM
Member
 
Join Date: Sep 2006
Posts: 68
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:

Expand|Select|Wrap|Line Numbers
  1. function onContactClick(e:MouseEvent):void
  2. {
  3.     gotoAndStop("contact");
  4. }
  5.  
  6. send_btn.addEventListener(MouseEvent.CLICK, submit);
  7.  
  8. function submit(e:MouseEvent):void
  9. {
  10.     var variables:URLVariables = new URLVariables();
  11.     variables.fromname = name_txt.text;
  12.     variables.fromemail = email_txt.text;
  13.     variables.fromsubject = subject_txt.text;
  14.     variables.frommessage = message_txt.text;
  15.  
  16.     var req:URLRequest = new URLRequest("contact.php");
  17.     req.data = variables;
  18.     req.method = URLRequestMethod.POST;
  19.  
  20.     var loader:URLLoader = new URLLoader();
  21.     loader.dataFormat = URLLoaderDataFormat.VARIABLES;
  22.     loader.addEventListener(Event.COMPLETE, sent);
  23.     loader.addEventListener(IOErrorEvent.IO_ERROR, error);
  24.     loader.load(req);
  25.     status_txt.text = "Sending...";
  26. }
  27.  
  28. function sent(e:Event):void
  29. {
  30.     status_txt.text = "Your email has been sent.";
  31.     name_txt.text = "";
  32.     subject_txt.text = "";
  33.     email_txt.text = "";
  34.     message_txt.text = "";
  35. }
  36.  
  37. function error(e:IOErrorEvent):void
  38. {
  39.     status_txt.text = "Error - please try again later.";
  40. }
Here is my code for my php file:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $sendto = 'run_for_life@verizon.net';
  4. $name = $_POST['fromname'];
  5. $from = $_POST['fromemail'];
  6. $subject = $_POST['fromsubject'];
  7. $message = $_POST['frommessage'];
  8.  
  9. $name = stripslashes($name);
  10. $from = stripslashes($from);
  11. $subject = stripslashes($subject);
  12. $message = stripslashes($message);
  13.  
  14. $data = "Name: " . $name . "\n";
  15. $data .= "Email: " . $from . "\n\n";
  16. $data .= "Subject: " . $subject . "\n\n\n";
  17. $data .= $message;
  18.  
  19. if(mail($sendto, $data))
  20. {
  21.     echo 'response=passed';
  22. }
  23. else
  24. {
  25.     echo 'response=failed';
  26. }
  27.  
  28. ?>
  #2  
Old July 6th, 2009, 04:27 PM
Member
 
Join Date: Sep 2006
Posts: 68

re: Variable Button is not defined?


It turned out to be the scrollbar component I brought to the stage.
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
FileDialog type not defined akmagnolia answers 2 July 23rd, 2007 09:15 PM
OPERATOR '&' IS NOT DEFINED dancer answers 39 May 12th, 2007 10:45 AM
How do I make sure that a asp page expires immediately and is not stored in the history ??? divya answers 6 October 13th, 2006 04:05 PM
Why 'event' is not defined in Mozilla prabhdeep@gmail.com answers 15 November 27th, 2005 09:25 AM