Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 08-11-2009, 11:26 PM   #1
wsound
Registered User
 
Join Date: Aug 2009
Posts: 3
Default Email form help

Im looking to see if someone would help me add something.
I have a template that when you hit send mail it just sits there it does send the mail but i need for it to say thank you or form has been submitted would someone help me fix this if I send you the fla file.
Mike Wilson
http://www.wilsonteammedia.com/sample.fla

Last edited by wsound; 08-11-2009 at 11:37 PM.
wsound is offline   Reply With Quote
Old 08-11-2009, 11:54 PM   #2
OmerHassan
Senior Member
 
Join Date: Mar 2009
Location: Islamabad, Pakistan
Posts: 207
Send a message via Skype™ to OmerHassan
Default

Are you using PHP to send mail? If yes, this is what you should do:
PHP Code:
<?php
    
if(mail($_GET["to"], $_GET["subject"], $_GET["message"]) // if sent
        
echo "sent";
?>
ActionScript Code:
sendBtn.addEventListener(MouseEvent.CLICK, sendIt); function sendIt(e:MouseEvent):void {     var sender:URLLoader = new URLLoader();     sender.addEventListener(Event.COMPLETE, thankYouMessage);     sender.load(new URLRequest("mail.php?to=" + to + "&subject=" + subject + "&message=" + message)); } function thankYouMessage(e:Event):void {     if(e.currentTarget.data == "sent")         trace("That thank-you message");     else         trace("Not sent."); }
OmerHassan is offline   Reply With Quote
Old 08-11-2009, 11:56 PM   #3
wsound
Registered User
 
Join Date: Aug 2009
Posts: 3
Default

If i send you the mail file can you fix this for me and download the fla and help Im in need of professional help

Last edited by wsound; 08-12-2009 at 12:02 AM.
wsound is offline   Reply With Quote
Old 08-12-2009, 05:48 AM   #4
Arif-sama
Senior Member
 
Arif-sama's Avatar
 
Join Date: Jan 2009
Location: Baku/Azerbaijan
Posts: 121
Send a message via ICQ to Arif-sama
Default

this is my code of sending e-mail with flash.
you wont go anywhere without PHP, so first create a PHP file and name it "contact.php". add this code:
PHP Code:
<?php

$sendto 
'[email protected]';
$subject 'write here some subject, your recepient will see it';
$name $_POST['fromname'];
$from $_POST['fromemail'];
$message $_POST['frommessage'];
$message stripslashes($message);

$content "Name: " $name "\n";
$content .= "E-mail: " $from "\n\n";
$content .= "Message: " $message;


if(
mail($sendto$subject$content))
{
    echo 
'response = passed';
}
else
{
    echo 
'response = fail';
}

?>
and this is the AS 3.0 code:
ActionScript Code:
stop (); send_mc.addEventListener (MouseEvent.CLICK, submit); clear_mc.addEventListener (MouseEvent.CLICK, clean); function submit (event:MouseEvent):void {     if ((name_txt.text != "") && (email_txt.text != "") && (message_txt.text != ""))     {         var variables:URLVariables = new URLVariables();         variables.fromname = name_txt.text;         variables.fromemail = email_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 = "Your message is sending, Please wait...";     }     else     {         status_txt.text = "Please, fill all fields";     } } function sent (event:Event):void {     status_txt.text = "Your message has been sent, thank you!";     name_txt.text = "";     email_txt.text = "";     message_txt.text = ""; } function error (event:IOError):void {     status_txt.text = "There was an error during sending the message, Please try again later"; } function clean (event:MouseEvent):void {     name_txt.text = "";     email_txt.text = "";     message_txt.text = ""; }
i assume there will be 3 fields: Name/email/message, 2 buttons: Clean/Send, and 1 status text bar.
Arif-sama is offline   Reply With Quote
Old 08-12-2009, 12:48 PM   #5
wsound
Registered User
 
Join Date: Aug 2009
Posts: 3
Default

Where do I paste the Action script Im kind of new to this my file is here if you can fix this I would really appreciate it. here is the file can you fix it and I would be glad to pay you.
http://www.wilsonteammedia.com/sample.fla
wsound is offline   Reply With Quote
Old 08-12-2009, 03:42 PM   #6
Arif-sama
Senior Member
 
Arif-sama's Avatar
 
Join Date: Jan 2009
Location: Baku/Azerbaijan
Posts: 121
Send a message via ICQ to Arif-sama
Default

sorry, thats action script 2.0, you posted in wrong sector of forum
Arif-sama is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:29 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.