PHP/Flash Email Form




  Tutorial Instructions



1. Create the necessary labels...
You will need labels for the Title, Full Name, Email, and Message

2. Create 3 input texts and set the variables to fullname, email, body.
Make sure you set the variable form field to those names, not the name of the movie clip. This will be important later for sending the variables to PHP...

3. Select the 3 input texts you created and Convert To > MovieClip. Name the instance mail_form.
This time make sure after you convert it, you name the <instance name> mail_form, not the variables, and not the name of the object.

4. Add code to the mail_form movie clip.

	onClipEvent(data){
		_root.gotoAndStop(2);
	}

5. Create a Submit button at the bottom and add the following code to it.
	on(release){
		_root.mail_form.loadVariables
		("http://www.yoursite.com/email.php",
		"POST");
	}

6. Create a second frame and insert a Dynamic Text: variable field to mail_form.success.
After you do this, go back to the first frame and add stop(); so it doesn't automatically head to the second frame before you press the submit button.

7. Add the code to email.php so grab the flash variables and return if it works or if errored.
You may download the source code from the files below to get the php file since it is kind of long.