AS2 Flash Contact Form
Here is a working example of flash contact form with simple validations using ActionScript 2 and PHP mail function. This flash email form can also immediately response back to you if the email was sent successfully or failed. You can easily copy the contact form movie clip and paste it into an empty frame of any flash template.
You need to replace below red line with your email address in send_email.php file.
$receiver = “youremail@yourdomain.com”;
If your web server does not support PHP, you will need to use any other supported server side language for mail function instead of using send_email.php file.
UPDATES (24 June 2008): Adding Email Auto Response in send_email.php file
-
<?php
-
$contact_name = $_POST[‘name’];
-
$contact_email = $_POST[‘email’];
-
$contact_subject = $_POST[’subject’];
-
$contact_message = $_POST[‘message’];
-
-
if( $contact_name == true )
-
{
-
$sender = $contact_email;
-
$receiver = “youremail@yourdomain.com”;
-
$client_ip = $_SERVER[‘REMOTE_ADDR’];
-
-
$email_body = “Name: $contact_name \nEmail: $sender \nSubject: $contact_subject \nMessage: $contact_message \nIP: $client_ip \nFlash Contact Form provided by http://www.flashmo.com”;
-
$email_body_auto_reply = “Hello $contact_name, \nThis is the auto reply message. Thank you. \nAdmin – http://www.flashmo.com”;
-
-
$extra_auto_reply = “From: $receiver\r\n“ . “Reply-To: $receiver \r\n“ . “X-Mailer: PHP/” . phpversion();
-
-
mail( $sender, “Auto Reply – Re: $subject”, $email_body_auto_reply, $extra_auto_reply ); // auto reply mail to sender
-
-
{
-
echo “success=yes”;
-
}
-
else
-
{
-
echo “success=no”;
-
}
-
}
-
?>
UPDATES (22 July 2008): Error correction in send_email.php file
Please change $subject to $contact_subject in line number 15.
Feel free to drop a comment if you have any question or feedback.
Related Post: Flash Contact Form in ActionScript 3




I have tried this form but I get stuck at the “sending….” message. Could you please help?
Dukes, you need to run it on your web server which supports PHP.
I am trying to run it from my web server and its not working. I looked at the actions for sending and it has “send_email.php?flashmo=” in the loadvariables. Do I need to change that to send_email.php?
What I am trying to do is put this on an existing fla I am working on
Dukes, Did you also upload send_email.php to your web server? Are you sure that your web server can run PHP?
Please take a look at http://www.flashmo.com/preview/flashmo_104_circular which is integrated with this contact form. You will get an idea.
[...] order to make the contact form in contact page to send to your email, please read this post. You may write a comment to this post if you have any [...]
I found my error. I had my html page in one folder and .swf and php file in another folder When I put them in the same folder everything works. Thanks for this form
Hi there I would like to say big thank you now is working fine .
Many thanks
Regard
Hi there,
im still having problems as featured above. It gets stuck on ’sending mail’. Ive even uploaded the default downloaded html, swf and php and just changed the email but still doesnt work.
Im running a php site on a linux server. So i shouldnt see a problem
Hope you can help
found that when i press the ’send’ button twice, it then sends and i receive it.
Can this be sorted to only press once?
phpmailer, please PHP mail function if it works or not.
< ? mail("youremail@domain.com","Subject","Test","From Tester"); ?>
Hi Dukes i had the same Problem before so this flash form works fine what you need to do go and check with
your hosting Package if that sport the PHP method or not if not you have to update it .
Good luck
where is the download button?
Download Source File link is located at the bottom of http://www.flashmo.com/preview/flashmo_102_contact_form
THanks
works PERFECTLY !!!!!
all that i needed !!
u rock !!
This may sound like a stupid question for the experienced – but we all have to start somewhere
) :
Is there any way you can make this form work from a stand-alone Flash Player .exe-file that runs from a CD or does it only work when executed on the web?
arneberg, you may send the form variables to a mail client (e.g. Outlook) if it is on CD-ROM.
Hi there,
where can I find the the line to amend
$receiver = “youremail@yourdomain.comâ€;
in the fla file. I have looked at the action script code on the mail form section but cannot seem to find it.
I am using the floral template.
Many thanks
Stuart
thebastion, please read it carefully again. That line is in send_email.php file, NOT the fla.
Is it possible to change the actionscript to loadvariables from the php file located on another server, ie http://www.blahblah.com/send_email.php. How would i do this?
Thanks
How do I edit the emailer in the flash websites…say for example file flashmo_079_classic.
Tan, it might be possible depending on security policies.
Aaron, just remove all keyframes at the last frame (which is the contact page) inside “flashmo contents” movie clip. And copy “contact form” movie clip from flashmo_102_contact_form.fla and paste it into any layer of the last frame in your “flashmo contents” movie clip of flashmo_079_classic.fla file.
thanks, I have yet to give it a dry run but I followed your intructs to the tee…Looks good. I also need help in the area…how do I add my own additional..say photos and other objects like a download button for pre-prepared forms and “send to a friend” links to the scripts and links to other websites. I have no idea where I post those. It’s away from all your help thus far…but could you help me…
This is just what I was looking for… Min Thu is the man!
Thanks,
BGLdesign
Hello!
Thanks so much for this free email form. I am wondering though if it is possible to put an AUTO RESPONSE function in its PHP? I’d appreciate a quick reply. Thanks a lot and more power.
Arvie Morales,
Yes, it is possible to put auto response in PHP file. I have updated my post above for it.
Hi there… I am a n00b at this stuff. I am using the flashmo_052 design and on the contact page I would like to add this contact form. I tried to import it into the library but it won’t let me. What is the best way to put this form into the .fla I am workin on.
Thank you so much for your help. I did read through the comments but did not find my answer.
Thanks so much
Hi again. I copied your contact form from the library of another flash template of yours and pasted it on the contact page of flashmo_052. I had to embed the text in the text fields in order for that to work. Here is my result..
http://birdsongmarketing.com/2008.html view contact page. I have mt .php on my server in the same folder as the swf file. the emaill address I am using is for the server I have this on. Which is info@birdsongmarketing.com For some reason it acts like it sent because all the text cleared out plus it does not say sending or message sent. Not sure if I inserted the contact form correct or not into this .fla file.
Any help would be most appreciated.
You Really Rock Macha
My host can run php. But when I have tried this form I get stuck at the “sending….†message like Dukes. What should I do ????
My site can run forum so it’s run Php contact form ?
if my server doesn’t support PHP, then what type of file extension do i use for the server side funtion posted at the top of this page
Hey my contact page seems to loop endlessly what could be the problem? Thanks in Advance.
I have done everything but my message still stuck at “sending…” what’s wrong with this???
“sending…†is just because your web server does not support PHP or PHP mail function.
My server is yahoo. And according to them, they support PHP/PHP mail function.
Hi,
I copied parts of the script and tried to integrate it with another flashmo template ( 074).
This is what i did, http://flash.pastebin.com/m101f379e
But i think the loadVariables() part is causing the trouble, as i can’t send the email with the above script, although the original fla works just fine. Can you please help?
Leo, I have looked at your codes. You cannot do like that way. Please follow steps in http://www.webdesignmo.com/blog/2008/05/26/as2-flash-contact-form/#comment-346
Hi,
I have inserted the contact form into my flash website but it is unclickable. The contact form is on a sub-page and it works fine if I just open that. But once I put the sub-page (with the contact form) into my main website, it becomes unclickable.
Appreciate the help!
hello sir i am trying it into my site
Ups, the Flash template is nowhere.
The link http://www.flashmo.com/download/flashmo_102_contact_form goes to a page with a link to the main page of flashmo.com
Mmm
Hello,
I have got the contact form working. But the message_status field doesn’t seem to work. I always get “sending..” displayed.
The email is being sent, so the php script must be echoing success=yes, I do not understand why flash doesn’t use that var?
Does the PHP file has to be in the “cgi-bin” folder of my server or in the same folder as my swf file?
————–
I have it in both sections and can’t get pass “sending”.
——————
thanks
I’m glad to say that the form finally works. I’m using it in the above flash template. Now I can move-on. For those of you who are haunted by the “sending” phenomenon, (as I was) try recopying the flashmo files into your server and the flash action script files and keep all files (html, swf, and send_email.php) in the root folder of your server (plublic_html). That’s what i did and it worked. Good luck and thanks to the administrator.
Bam, I am glad to know that your form works finally.
I’m so so English.Please Turkish ??
can you tell me how I can change the auto response message in the original AS2 Contact form
know you if hotmail support php ? Contact Form Flash does not work. The 4 files are in the same directory.I already changed ($receiver = “info@flashmo.com”;) in send_email.php
ANYONE! can you tell me how I can change the auto response message in the original AS2 Contact form. send an email to arebegees@gmail.com
I’ve noticed in both versions of the script (sans auto-reply and auto-reply) you forgot to add “contact_” to the $subject variable when setting up the mail function. These need to be changed from $subject to $contact_subject or else the subject on the form email and auto reply wont display the subject properly.
Thanks a million for this script. After a week of sheer frustration and 3 other scripts this is the first one i’ve used that seems to work properly!
Burntproduce, Thank you for pointing me out about the mistake – $contact_subject variable. I have corrected above.
You are right that $subject variable will not work if the PHP variable register_global = off in PHP.ini settings.