Flash Kid Logo  
Home - Tutorials - Applications - Games - Books - Community - Site Map - Contact Us  
 
 











 
 
 
Flash Contact Form Errors - 2 / 2
Author: Salman Awan
Difficulty Level: Intermediate
Flash Version: Flash MX 2004
Sources to Download: mailtest.php
 
Bookmark This Page
Prerequisites: Basic ActionScripting, PHP Scripting, Flash Contact Form

Introduction:
This tutorial is more of a guide to trouble shoot your flash contact php form errors. Yes i understand setting up an email form in flash can be tricky, thus it is compiled while considering so many troubleshooting related queries to my Flash Contact Form tutorial posted earlier on FlashKid.


This guide will work fine for all email contact forms in flash with php or asp, no matter what tutorial you tried to follow earlier, as long as basic technology remains the same. This tutorial will guide you to trouble shoot your flash-server-flash trip in few steps, so let's get started.


1. Adding Contact Form into Your Flash Movie:

In original tutorial's source files here, i have updated the flash file, so that now Contact Form is in a separate movie clip. Thus allowing you to simply copy the movie clip in first frame and pate it in your flash file at appropriate place. This way email form's variables will not interface with your other variables of same name by any chance, and implementing it has become simple copy paste activity.


2. Testing Flash Contact Form in Flash Authoring Environment:

Before uploading our files to server, we need to check if values are read and sent fine to mail.php page, from within Flash Authoring Environment.

To do this, Control > Test Movie , navigate to your contact page, enter some values in contact form and press Submit button. In Output window you’ll see values you entered. If that is the case, then it means flash will pass values to mail.php page just fine.

So now we need to test if server is doing its job as well.


3. Testing Email Server & Email Script:

Before uploading our flash file and email script on server, we will perform a test on server. This step will ensure us two things:

i. Our web server supports sending of emails.
ii. Our email sending script for server is working fine and it's functions are supported on our server in language of our choice (PHP or ASP)

So to perform this test, we create a test file, which will not receive email parameters from flash, but will have them hard coded i.e. written in mailtest.php by ourselves.

You can download mailtest.php file from source files of this tutorial above.

Note: Do not forget to replace default To: email address with yours.


After changing email in mailtest.php page (you can do that by opening it in notepad), Upload this test file to your web server and then access this page in web browser like this:

http://www.YOURWEBSITE.com/mailtest.php

Simply accessing this page in browser will execute the php script and email will be sent to your address specified in test file.


Note:
Please check your junk folder as well, confirmation email might be sent there.


If email is received fine from your server then we are good to move to next step.


4. Connecting Flash and PHP:

So till now our flash contact form in isolation is working fine, php email script on server is working fine and emails are received from server in our mail box.

So let's see if every thing works well when put together.

Let's upload all our files including flash swf and mail.php file to server. Make sure you have changed your email address in mail.php file as well.


Not:
Upload mail.php in same folder where index.html page is placed, not in folder where your .swf file is placed. (in case you are moving swf in another folder)


5. Undefined Error:

Sometimes when you have received an email in your box by the flash contact form and everything is working fine, you might still be seeing Undefined in response text box in flash contact form. Instead of contact form error you should be seeing a success message similar to that in mail.php.

There can be number of possible reasons for that:

a. Check your variable names.
b. Scope of variable is not correct that received response, and when assigning it to text field.
c. Message in php is not properly formatted.
d. Some function error e.g. loadvariable etc. which you are using to receive back the resonpse.


Try investigating these possible reasons and fix errors, If you are still facing issues while implementing contact flash form, please feel free to post your problem using forum link below.

 

 
 
 
 
Related Links
Discussion Forum for Flash Contact Form Tutorial
 
 

 
 
 
© 2008 flashkid.org! All Rights Reserved.
 
   
 
a project of: xonsolutions.com, other projects: tutorialkid.org