Make a Flash Contact Form Function Correctly

  • geno369329
  • Beginner
  • Beginner
  • User avatar
  • Posts: 44

Post 3+ Months Ago

Hey guys,

I'm really new to this flash world!

I have purchased a template and I need to modify my contact box so that the messages come to my business address.

Also I know its possible, but how hard would it be to have an automatic response to people who leave a message in my contact box such as:

"Thank you
We have recieved your email and we will get back to you shortly."


Below is a screen shot of my contact box


Image


Here is the code for my reset button
Code: [ Select ]
on (rollOver){this.gotoAndPlay("s1");}
on (releaseOutside, rollOut){this.gotoAndPlay("s2");}
on (release) { 
    _parent.t1_2 = "Your full name:";
    _parent.t2_2 = "E-mail address:";
    _parent.t3_2 = "Your telephone:";
    _parent.t4_2 = "Message:";
}
  1. on (rollOver){this.gotoAndPlay("s1");}
  2. on (releaseOutside, rollOut){this.gotoAndPlay("s2");}
  3. on (release) { 
  4.     _parent.t1_2 = "Your full name:";
  5.     _parent.t2_2 = "E-mail address:";
  6.     _parent.t3_2 = "Your telephone:";
  7.     _parent.t4_2 = "Message:";
  8. }




Here is the code for my send button
Code: [ Select ]
on (rollOver){this.gotoAndPlay("s1");}
on (releaseOutside, rollOut){this.gotoAndPlay("s2");}
on (release) { 
    _parent.getURL ("contact.php","_blank","GET");
    _parent.t1_2 = "Your full name:";
    _parent.t2_2 = "E-mail address:";
    _parent.t3_2 = "Your telephone:";
    _parent.t4_2 = "Message:";
}
  1. on (rollOver){this.gotoAndPlay("s1");}
  2. on (releaseOutside, rollOut){this.gotoAndPlay("s2");}
  3. on (release) { 
  4.     _parent.getURL ("contact.php","_blank","GET");
  5.     _parent.t1_2 = "Your full name:";
  6.     _parent.t2_2 = "E-mail address:";
  7.     _parent.t3_2 = "Your telephone:";
  8.     _parent.t4_2 = "Message:";
  9. }



As far as I know everything is right in it, but please don't hesitate to prove me wrong...I just want to get this box working!

And after doing a billion searches I came across a few people who said that I need to make a txt file with this code in it

Code: [ Select ]
<?php
 
    $your_name = $_GET[ ‘name’ ];
    $your_email = $_GET[ ‘email’ ];
    $your_phone = $_GET[ ‘phone’ ];
    $your_message = $_GET[ ‘message’ ];
 
    $recipient_mail = “iputmyemailaddresshere@mail.com”;
 
    $subject = “from” . $your_email;
    $headers = “From: “ . $your_email . “ <” . $your_email . “>\n”;
    $headers .= ‘Content-type: text/html; charset=iso-8859-1’;
 
    $content = “<html><head><title>Contact letter<title></head><body><br>”;
    $content .= “Name: <b>” . $your_name . “</b><br>”;
    $content .= “Email: <b>” . $your_email . “</b><br><hr><br>”;
    $content .= “phone: <b>” . $your_phone . “</b><br>”;
    $content .= $your_message;
    $content .= “<br></body><html>”;
 
    mail ($recipient_email,$subject,$content,$headers) ;
?>
<html>
    <body bgcolor=”#282E2C”>
        <div align=”center” style=”margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold”>
            Your message was sent. Thank you.
        </div>
    </body>
</html>
<script>resizeTo(300, 300)</script>
 
  1. <?php
  2.  
  3.     $your_name = $_GET[ ‘name’ ];
  4.     $your_email = $_GET[ ‘email’ ];
  5.     $your_phone = $_GET[ ‘phone’ ];
  6.     $your_message = $_GET[ ‘message’ ];
  7.  
  8.     $recipient_mail = “iputmyemailaddresshere@mail.com”;
  9.  
  10.     $subject = “from” . $your_email;
  11.     $headers = “From: “ . $your_email . “ <” . $your_email . “>\n”;
  12.     $headers .= ‘Content-type: text/html; charset=iso-8859-1’;
  13.  
  14.     $content = “<html><head><title>Contact letter<title></head><body><br>”;
  15.     $content .= “Name: <b>” . $your_name . “</b><br>”;
  16.     $content .= “Email: <b>” . $your_email . “</b><br><hr><br>”;
  17.     $content .= “phone: <b>” . $your_phone . “</b><br>”;
  18.     $content .= $your_message;
  19.     $content .= “<br></body><html>”;
  20.  
  21.     mail ($recipient_email,$subject,$content,$headers) ;
  22. ?>
  23. <html>
  24.     <body bgcolor=”#282E2C”>
  25.         <div align=”center” style=”margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold”>
  26.             Your message was sent. Thank you.
  27.         </div>
  28.     </body>
  29. </html>
  30. <script>resizeTo(300, 300)</script>
  31.  


...I'm guessing then I need to upload that file to my website??

Any help with this is really appreciated!!

Thanks
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • geno369329
  • Beginner
  • Beginner
  • User avatar
  • Posts: 44

Post 3+ Months Ago

I think I'm in the right direction, but when I hit the send button, it opens up a blank page!!

Heeelllp me....i'm melting...no but seriously help a brotha out!!

Thanks!!
  • geno369329
  • Beginner
  • Beginner
  • User avatar
  • Posts: 44

Post 3+ Months Ago

I've updated my code, but I'm still missing something. I keep getting a blank page

here's the code for my reset button
Code: [ Select ]
on (rollOver){
    gotoAndPlay("s1");
}
on (rollOut, releaseOutside) {
    gotoAndPlay("s2");
}
on (release) { 
    _parent.name="Your full name:";
    _parent.email="E-mail address:";
    _parent.phone="Your telephone:";
    _parent.message="Message:";
 
}
  1. on (rollOver){
  2.     gotoAndPlay("s1");
  3. }
  4. on (rollOut, releaseOutside) {
  5.     gotoAndPlay("s2");
  6. }
  7. on (release) { 
  8.     _parent.name="Your full name:";
  9.     _parent.email="E-mail address:";
  10.     _parent.phone="Your telephone:";
  11.     _parent.message="Message:";
  12.  
  13. }



Here is the code for my submit button
Code: [ Select ]
on (rollOver) {
    gotoAndPlay("s1");
}
on (rollOut, releaseOutside) {
    gotoAndPlay("s2");
}
on (release) { 
    _parent.getURL ("contact.php","_blank","GET");
    _parent.name="Your full name:";
    _parent.email="E-mail address:";
    _parent.phone="Your telephone:";
    _parent.message="Message:";
}
  1. on (rollOver) {
  2.     gotoAndPlay("s1");
  3. }
  4. on (rollOut, releaseOutside) {
  5.     gotoAndPlay("s2");
  6. }
  7. on (release) { 
  8.     _parent.getURL ("contact.php","_blank","GET");
  9.     _parent.name="Your full name:";
  10.     _parent.email="E-mail address:";
  11.     _parent.phone="Your telephone:";
  12.     _parent.message="Message:";
  13. }


I also upload a file by the name of "contact.php"

here's the code I have in that file
Code: [ Select ]
<?php
 
    $your_name = $_GET[ ‘name’ ];
    $your_email = $_GET[ ‘email’ ];
    $your_phone = $_GET[ ‘phone’ ];
    $your_message = $_GET[ ‘message’ ];
 
    $recipient_mail = “myemail@mymail.com”;
 
    $subject = “from” . $your_email;
    $headers = “From: “ . $your_email . “ <” . $your_email . “>\n”;
    $headers .= ‘Content-type: text/html; charset=iso-8859-1’;
 
    $content = “<html><head><title>Contact letter<title></head><body><br>”;
    $content .= “Name: <b>” . $your_name . “</b><br>”;
    $content .= “Email: <b>” . $your_email . “</b><br><hr><br>”;
    $content .= “phone: <b>” . $your_phone . “</b><br>”;
    $content .= $your_message;
    $content .= “<br></body><html>”;
 
    mail ($recipient_email,$subject,$content,$headers) ;
?>
<html>
    <body bgcolor=”#282E2C”>
        <div align=”center” style=”margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold”>
            Your message was sent. Thank you.
        </div>
    </body>
</html>
<script>resizeTo(300, 300)</script>
 
  1. <?php
  2.  
  3.     $your_name = $_GET[ ‘name’ ];
  4.     $your_email = $_GET[ ‘email’ ];
  5.     $your_phone = $_GET[ ‘phone’ ];
  6.     $your_message = $_GET[ ‘message’ ];
  7.  
  8.     $recipient_mail = “myemail@mymail.com”;
  9.  
  10.     $subject = “from” . $your_email;
  11.     $headers = “From: “ . $your_email . “ <” . $your_email . “>\n”;
  12.     $headers .= ‘Content-type: text/html; charset=iso-8859-1’;
  13.  
  14.     $content = “<html><head><title>Contact letter<title></head><body><br>”;
  15.     $content .= “Name: <b>” . $your_name . “</b><br>”;
  16.     $content .= “Email: <b>” . $your_email . “</b><br><hr><br>”;
  17.     $content .= “phone: <b>” . $your_phone . “</b><br>”;
  18.     $content .= $your_message;
  19.     $content .= “<br></body><html>”;
  20.  
  21.     mail ($recipient_email,$subject,$content,$headers) ;
  22. ?>
  23. <html>
  24.     <body bgcolor=”#282E2C”>
  25.         <div align=”center” style=”margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold”>
  26.             Your message was sent. Thank you.
  27.         </div>
  28.     </body>
  29. </html>
  30. <script>resizeTo(300, 300)</script>
  31.  


Please Help:)
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

Well, there's really no need to actually "display" the php page at all. The attached zip file contains a form contact page I use at work. It's a little more complex than your basic form but contains all the necessary elements to a good working form using a php mailer. (I've altered this a bit from the original, but credit to UNFLUX who designed the original page)
Attachments:
contactForm.zip

(130.97 KiB) Downloaded 989 times

Includes FLA and php scrip for generalContact.



When you open the FLA in your actions panel, in the left pane expand formGeneral and take a look at the submit button code.

Code: [ Select ]
on (release) {
    if (name eq "" or email eq "" or message eq "") {
        error.gotoAndPlay("error");
    } else {
        loadVariablesNum("contactGeneral.php", 0, "POST");
        error.gotoAndPlay("sent");
        name = "";
        company = "";
        phone = "";
        email = "";
        message = "";
    }
}
 
  1. on (release) {
  2.     if (name eq "" or email eq "" or message eq "") {
  3.         error.gotoAndPlay("error");
  4.     } else {
  5.         loadVariablesNum("contactGeneral.php", 0, "POST");
  6.         error.gotoAndPlay("sent");
  7.         name = "";
  8.         company = "";
  9.         phone = "";
  10.         email = "";
  11.         message = "";
  12.     }
  13. }
  14.  


Lets break that down. When we release the button the first thing we do is check to see if all required fields are completed. It's always a good idea to require at least some if not all fields to avoid getting empty emails.
Code: [ Select ]
if (name eq "" or email eq "" or message eq "")

*note - name, company, phone, email, and message are the variable names given to the respective text input fields. The code above then uses those variables to pass to your php script.

If any of the required fields is empty we send the user an error message
Code: [ Select ]
error.gotoAndPlay("error");


the first "error" in the code above is the instance name of a movie clip called error which basically contains two messages. One is a sent successfully message, the other is an error message telling them to complete all required fields. In the attached FLA you can see the error movie clip by selecting it from the library to edit.

The second "error" in parenthesis is the label assigned to the error message.
If all required fields are met, then we're going to load contactGeneral.php which is my mail script
Code: [ Select ]
loadVariablesNum("contactGeneral.php", 0, "POST");


Here we use loadVariablesNum instead of getUrl which simply loads the Variables into the php script and we do this by the POST method vs the GET method.
The variables we are loading are
Code: [ Select ]
name = "";
        company = "";
        phone = "";
        email = "";
        message = "";
  1. name = "";
  2.         company = "";
  3.         phone = "";
  4.         email = "";
  5.         message = "";


Essentially it's identical to your fields except I have a company field in mine.
Then to give them a success message we send them back to the "error" movieClip at the label "sent" which displays the success message, which in your case is where you could have:
"Thank you
We have recieved your email and we will get back to you shortly."
Code: [ Select ]
error.gotoAndPlay("sent");


The included php file, now is pretty self explanatory:
Code: [ Select ]
<?
 
   if (isset($HTTP_POST_VARS)) {
               
                $name = $HTTP_POST_VARS["name"];
                $company = $HTTP_POST_VARS["company"];
                $phone = $HTTP_POST_VARS["phone"];
                $email = $HTTP_POST_VARS["email"];
                $message = $HTTP_POST_VARS["message"];
                }
 
   $to = "generalContact@alaron-nuclear.com";
     $from = "webmaster@alaron-nuclear.com";
   $subject = "Alaron General Contact Form";
   $msg .= "Senders Name: " ."$name\n\n";
   $msg .= "Company: " ."$company\n\n";
   $msg .= "Phone: " ."$phone\n\n";
   $msg .= "Email: " ."$email\n\n";
   $msg .= "Message: " ."$message\n\n";
     $msg .= "This message was sent to you from Alaron-Nuclear Contact Request Form.\n\n";
     $msg .= "Do not reply to this email directly.";
 
  mail($to, $from, $subject, $msg, "From: Alaron Web Site\nReply-To: $email\n");
 
?>
  1. <?
  2.  
  3.    if (isset($HTTP_POST_VARS)) {
  4.                
  5.                 $name = $HTTP_POST_VARS["name"];
  6.                 $company = $HTTP_POST_VARS["company"];
  7.                 $phone = $HTTP_POST_VARS["phone"];
  8.                 $email = $HTTP_POST_VARS["email"];
  9.                 $message = $HTTP_POST_VARS["message"];
  10.                 }
  11.  
  12.    $to = "generalContact@alaron-nuclear.com";
  13.      $from = "webmaster@alaron-nuclear.com";
  14.    $subject = "Alaron General Contact Form";
  15.    $msg .= "Senders Name: " ."$name\n\n";
  16.    $msg .= "Company: " ."$company\n\n";
  17.    $msg .= "Phone: " ."$phone\n\n";
  18.    $msg .= "Email: " ."$email\n\n";
  19.    $msg .= "Message: " ."$message\n\n";
  20.      $msg .= "This message was sent to you from Alaron-Nuclear Contact Request Form.\n\n";
  21.      $msg .= "Do not reply to this email directly.";
  22.  
  23.   mail($to, $from, $subject, $msg, "From: Alaron Web Site\nReply-To: $email\n");
  24.  
  25. ?>



Hope that helps and doesn't confuse you more.
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

PHP Code: [ Select ]
$recipient_mail = <!-- e -->ebrown@2duce2.com<!-- e -->;

should be
PHP Code: [ Select ]
$recipient_mail = <!-- e -->'ebrown@2duce2.com<!-- e -->';


Note the quotes.
  • geno369329
  • Beginner
  • Beginner
  • User avatar
  • Posts: 44

Post 3+ Months Ago

I really appreciate all the help!! You're officially my new hero:)

Oh and sorry for duplicate post!!

Heres where I'm at now!!

When I leave all the text fields in my contact box empty and click the submit button two things happen!!
There is no error message and I get a blank email

I'm guessing that I'm missing some code and thats why I don't have the error message.

As far as the email goes I'm glad I'm finally getting emails, but I only get them when I leave the fields blank.

Here's the email I get
    Senders Name:

    Email:

    Phone:

    Message:

    This message was sent to you from 2Duce2 Wedding videos Contact Request Form.

    Do not reply to this email directly.

    2Duce2 Wedding Videos


Here is the code of my submit button
Code: [ Select ]
on (rollOver) {
    gotoAndPlay("s1");
}
on (rollOut, releaseOutside) {
    gotoAndPlay("s2");
}
on (release) { 
    if (name eq "" or email eq "" or message eq "") {
        error.gotoAndPlay("error");
    } else {
        loadVariablesNum("contactGeneral.php", 0, "POST");
    error.gotoAndPlay("sent");
        name = "";
        company = "";
        phone = "";
        email = "";
        message = "";
    }
}
  1. on (rollOver) {
  2.     gotoAndPlay("s1");
  3. }
  4. on (rollOut, releaseOutside) {
  5.     gotoAndPlay("s2");
  6. }
  7. on (release) { 
  8.     if (name eq "" or email eq "" or message eq "") {
  9.         error.gotoAndPlay("error");
  10.     } else {
  11.         loadVariablesNum("contactGeneral.php", 0, "POST");
  12.     error.gotoAndPlay("sent");
  13.         name = "";
  14.         company = "";
  15.         phone = "";
  16.         email = "";
  17.         message = "";
  18.     }
  19. }



And here is my PHP file
Code: [ Select ]
<?
 
   if (isset($HTTP_POST_VARS)) {
               
                $name = $HTTP_POST_VARS["name"];
                $phone = $HTTP_POST_VARS["phone"];
                $email = $HTTP_POST_VARS["email"];
                $message = $HTTP_POST_VARS["message"];
                }
 
   $to = "ebrown@2duce2.com";
     $from = "info@2duce2.com";
   $subject = "2Duce2 Wedding Videos";
   $msg .= "Senders Name: " ."$name\n\n";
   $msg .= "Email: " ."$email\n\n";
   $msg .= "Phone: " ."$phone\n\n";
   $msg .= "Message: " ."$message\n\n";
     $msg .= "This message was sent to you from 2Duce2 Wedding videos Contact Request Form.\n\n";
     $msg .= "Do not reply to this email directly.";
 
  mail($to, $from, $subject, $msg, "From: 2Duce2 Wedding Videos\nReply-To: $email\n");
 
?>
 
  1. <?
  2.  
  3.    if (isset($HTTP_POST_VARS)) {
  4.                
  5.                 $name = $HTTP_POST_VARS["name"];
  6.                 $phone = $HTTP_POST_VARS["phone"];
  7.                 $email = $HTTP_POST_VARS["email"];
  8.                 $message = $HTTP_POST_VARS["message"];
  9.                 }
  10.  
  11.    $to = "ebrown@2duce2.com";
  12.      $from = "info@2duce2.com";
  13.    $subject = "2Duce2 Wedding Videos";
  14.    $msg .= "Senders Name: " ."$name\n\n";
  15.    $msg .= "Email: " ."$email\n\n";
  16.    $msg .= "Phone: " ."$phone\n\n";
  17.    $msg .= "Message: " ."$message\n\n";
  18.      $msg .= "This message was sent to you from 2Duce2 Wedding videos Contact Request Form.\n\n";
  19.      $msg .= "Do not reply to this email directly.";
  20.  
  21.   mail($to, $from, $subject, $msg, "From: 2Duce2 Wedding Videos\nReply-To: $email\n");
  22.  
  23. ?>
  24.  


Once again I want to thank you for all of your help and patients with me!
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

check each of your input text fields properties. I'm pretty sure you've already assigned each of them an instance name, but make sure in the variable box you've included the variable name.

In other words for your Senders Name input box, the variable should be "name" for the email input box the variable should be "mail", etc. You can also lose company = ""; from your ActionScript since you aren't using a Company input box.
  • geno369329
  • Beginner
  • Beginner
  • User avatar
  • Posts: 44

Post 3+ Months Ago

Here are screen shots of each of my text field settings

Name

http://2duce2.com/forumpics/name.tiff

Email

http://2duce2.com/forumpics/email.tiff

Telephone

http://2duce2.com/forumpics/telephone.tiff

Message

http://2duce2.com/forumpics/message.tiff



Also I went ahead and took out the company = "";

I'm getting emails when I leave the form blank, but I'm also getting emails when I fill out the information, but the emails I get are still blank emails

Image


Also my reset button now resets everything besides the email address
Code: [ Select ]
on (rollOver){
    gotoAndPlay("s1");
}
on (rollOut, releaseOutside) {
    gotoAndPlay("s2");
}
on (release) { 
    _parent.name="Your full name:";
    _parent.email="E-mail address:";
    _parent.phone="Your telephone:";
    _parent.message="Message:";
 
  1. on (rollOver){
  2.     gotoAndPlay("s1");
  3. }
  4. on (rollOut, releaseOutside) {
  5.     gotoAndPlay("s2");
  6. }
  7. on (release) { 
  8.     _parent.name="Your full name:";
  9.     _parent.email="E-mail address:";
  10.     _parent.phone="Your telephone:";
  11.     _parent.message="Message:";
  12.  
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

I think you're almost there!

The blank emails are being caused because you didn't set a maximum characters for your input fields. They are all set to a maximum of "0" characters (it's probably also why when you leave them blank it's allowing those to be sent also).

For example I have my max characters set to the following:
name = 25
phone = 25
email = 45
message = 500

You can adjust those numbers to anything you like.
From your images it looks like you also have the option to "render textas HTML" turned on. That's the greater than less than <> button to the left of your variable field. I would recommend turning that off on all fields or you might get html code in your email if you are set to receive mail as text only.

Fix that and you should solve the remainder of your issues. However, I am uncertain why your reset button is not resetting your email field. I don't have an answer for you on that one.

*note for reference, posting tiff images inline at OZZU doesn't work with the bbCode as tiff isn't supported. In the future save them as jpg images and they'll display.
  • geno369329
  • Beginner
  • Beginner
  • User avatar
  • Posts: 44

Post 3+ Months Ago

I'm still getting blank emails

Here is another set of code that came with the contact box. Maybe there is a bit of code thats not set right?
Code: [ Select ]
t1.onSetFocus = function() {
    if (t1_2 == "Your full name:") {
        t1_2 = "";
    }
    // end if
};
t2.onSetFocus = function() {
    if (t2_2 == "E-mail address:") {
        t2_2 = "";
    }
    // end if
};
t3.onSetFocus = function() {
    if (t3_2 == "Your telephone:") {
        t3_2 = "";
    }
    // end if
};
t4.onSetFocus = function() {
    if (t4_2 == "Message:") {
        t4_2 = "";
    }
    // end if
};
t1.onKillFocus = function() {
    if (t1_2 == "") {
        t1_2 = "Your full name:";
    }
    // end if
};
t2.onKillFocus = function() {
    if (t2_2 == "") {
        t2_2 = "E-mail address:";
    }
    // end if
};
t3.onKillFocus = function() {
    if (t3_2 == "") {
        t3_2 = "Your telephone:";
    }
    // end if
};
t4.onKillFocus = function() {
    if (t4_2 == "") {
        t4_2 = "Message:";
    }
    // end if
};
 
  1. t1.onSetFocus = function() {
  2.     if (t1_2 == "Your full name:") {
  3.         t1_2 = "";
  4.     }
  5.     // end if
  6. };
  7. t2.onSetFocus = function() {
  8.     if (t2_2 == "E-mail address:") {
  9.         t2_2 = "";
  10.     }
  11.     // end if
  12. };
  13. t3.onSetFocus = function() {
  14.     if (t3_2 == "Your telephone:") {
  15.         t3_2 = "";
  16.     }
  17.     // end if
  18. };
  19. t4.onSetFocus = function() {
  20.     if (t4_2 == "Message:") {
  21.         t4_2 = "";
  22.     }
  23.     // end if
  24. };
  25. t1.onKillFocus = function() {
  26.     if (t1_2 == "") {
  27.         t1_2 = "Your full name:";
  28.     }
  29.     // end if
  30. };
  31. t2.onKillFocus = function() {
  32.     if (t2_2 == "") {
  33.         t2_2 = "E-mail address:";
  34.     }
  35.     // end if
  36. };
  37. t3.onKillFocus = function() {
  38.     if (t3_2 == "") {
  39.         t3_2 = "Your telephone:";
  40.     }
  41.     // end if
  42. };
  43. t4.onKillFocus = function() {
  44.     if (t4_2 == "") {
  45.         t4_2 = "Message:";
  46.     }
  47.     // end if
  48. };
  49.  


I'm sorry I keep bugging you!! I really appreciate your help though!!
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

I'm not certain where the t1-t4 are coming from. At first I thought they were the instance names of your text input fields but I noticed in your images that you didn't give them instance names.


Can you include a link to your current FLA?
  • geno369329
  • Beginner
  • Beginner
  • User avatar
  • Posts: 44

Post 3+ Months Ago

I didn't have instance names but after seeing the code in my previous post, I went ahead and added the t1-t4 in the instance name fields!!

I think this is the link you want

//link available via PM for trusted members - removed because it's a template.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

Got the FLA. However I'm leaving work shortly and won't be able to look at it until tomorrow. There's a couple of good Flash people here that might catch it in the meantime so be patient and keep plugging away. You're making progress.

//I removed the FLA link since it was a purchased template. If someone else wants to take a look I'll provide it in PM. I know the members I can trust with it.
  • geno369329
  • Beginner
  • Beginner
  • User avatar
  • Posts: 44

Post 3+ Months Ago

hey thanks man!!

hopefully i'll make some progress:)

Take care!!
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

I haven't been following this to closely but I wonder if the loadVarsNum is the issue. I wasn't aware that you could do outward communication with that. Instead I would use the SendandLoad() command.

Here's an example of the usage. I can't tell you exactly how to implement without seeing your code and I don't have time to dig into it tonight, but at least its a place to start tracking down issues tomorrow.
  • geno369329
  • Beginner
  • Beginner
  • User avatar
  • Posts: 44

Post 3+ Months Ago

Thanks I'll check it out
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

I'll send you his FLA tomorrow in PM graphixboy if he hasn't got it by then. I think I ended up using loadVarsNum because I run a Windows server, but it works for me perfectly. The code I posted is the code currently in place at my Alaron site in my sig.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

hmmmmm sandbox security rule? http://www.ultrashock.com/forums/flash- ... 76238.html
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

another thought and this could well be the reason it works for me and not geno. Using loadVarsNum is typically used when loading vars into a different level which I'm doing. so graphixboy's suggestion of sendAndLoad might be the better alternative.
  • geno369329
  • Beginner
  • Beginner
  • User avatar
  • Posts: 44

Post 3+ Months Ago

This is the code thats in the example graphicboy gave me. where would I put this code? would I make another PHP file to put it in or what!!


Code: [ Select ]
var emailServer:String = "http://server.com/email.php"
 
var request:LoadVars = new LoadVars();
var response:LoadVars = new LoadVars();
    response.onLoad = showResult;
 
/************************
Server Request
************************/
function sendEmail():Void{
    request.name = "chrisaiv";
    request.email = "blah@blah.com";
    request.url = "http://sendtoafriend";
    request.sendAndLoad(emailServer + "?clearCache=" + new Date().getTime(), response, "GET");
 
    //Show data sent
    for (var prop in request){
        //trace( request[prop] + newline);
    }
}
 
/************************
Server Response
************************/
function showResult():Void{
    if (this.success) {
        trace("File path: " + this.success);
    }
}
 
sendEmail();
  1. var emailServer:String = "http://server.com/email.php"
  2.  
  3. var request:LoadVars = new LoadVars();
  4. var response:LoadVars = new LoadVars();
  5.     response.onLoad = showResult;
  6.  
  7. /************************
  8. Server Request
  9. ************************/
  10. function sendEmail():Void{
  11.     request.name = "chrisaiv";
  12.     request.email = "blah@blah.com";
  13.     request.url = "http://sendtoafriend";
  14.     request.sendAndLoad(emailServer + "?clearCache=" + new Date().getTime(), response, "GET");
  15.  
  16.     //Show data sent
  17.     for (var prop in request){
  18.         //trace( request[prop] + newline);
  19.     }
  20. }
  21.  
  22. /************************
  23. Server Response
  24. ************************/
  25. function showResult():Void{
  26.     if (this.success) {
  27.         trace("File path: " + this.success);
  28.     }
  29. }
  30.  
  31. sendEmail();
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

no don't use that. That's ASP code. you are using php. I'll look at your FLA in the AM and send the link for it to graphixboy in case he wants to check it out. Can't do it now cause I saved it to a network drive which I don't have access to at the moment.

//edit strike that - it's not ASP code but sure looked like it at a glance, but it'll just mess up your template. so still don't use it. I just looked at the example link he posted. It'll confuse the hell out of everything you've got going. Good code, but you can work around it I'm sure.
  • geno369329
  • Beginner
  • Beginner
  • User avatar
  • Posts: 44

Post 3+ Months Ago

okay!! I'm gonna call it a night then!!

Have a good night!!
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

This is probably a better example of how sendAndLoad works considering your form
http://www.emanueleferonato.com/2008/06 ... ndandload/

Don't even think about copying that into your form. It's just a better example that demonstrates the use, but it has nothing to do with emailing - just educational.
  • geno369329
  • Beginner
  • Beginner
  • User avatar
  • Posts: 44

Post 3+ Months Ago

thanks for the link!! Definitely helpful!!
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

I did look at it this morning and can't put my finger on why mine works and yours doesn't. Unfortunately I'm too busy at work today to give it any more attention and might not get back to this until the weekend. I just sent the link to your FLA to graphixboy in PM in case he has a moment to check it out.
  • geno369329
  • Beginner
  • Beginner
  • User avatar
  • Posts: 44

Post 3+ Months Ago

Thanks! I really appreciate it man!!
  • geno369329
  • Beginner
  • Beginner
  • User avatar
  • Posts: 44

Post 3+ Months Ago

This is drivin' me crazy!! Anyone else have any advice?
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

graphixboy told me he's taking a look at it. Be patient.
  • geno369329
  • Beginner
  • Beginner
  • User avatar
  • Posts: 44

Post 3+ Months Ago

I don't know if its worth mentioning, but I host my website on yahoo. Could that be affecting my contact box?
  • geno369329
  • Beginner
  • Beginner
  • User avatar
  • Posts: 44

Post 3+ Months Ago

I"m finally getting emails...but no confirmation...Wayyyy better than yesterday!!

Thanks Graphixboy and ATNO/TW

you guys are the best ever in the world:)
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 62 posts
  • Users browsing this forum: No registered users and 19 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.