The Flash form consists of 2 basic parts. One part is the group of text fields that make up the form. These are actually contained within a movieclip aptly named “form.” Secondly, you have the send button. This will be the button that activates the code that sends the form information to the PHP file. At that point, Flash’s job is done. It’s then up to the PHP script to make sure the email gets sent.
1. Start off by making the appropriate form fields. Make sure these are input fields and not static or dynamic text fields Include as many as you want. Each will be sent to the PHP file where they can then be sorted. This example uses 3.
2. Assign each text field a var value. This is NOT an instance name. The var field allows you to associate a variable with the given text field Because loadVariables is being used to transmit the information, this is needed to make the value of these text fields easily recognized as variables to that command. This example uses name, email, and body for field variable names.
3. Once you have created and named each field, select them all and create a new movieclip out of them. This will be the form movieclip. Give it the instance name form when you’re done.
4. Next, create a button. This will serve as the send button. This will exist not within the form, but in the same place as the form. It’s on this button that the loadVariables script will be added. That script is as follows: form.loadVariables(”email.php”, “POST”);
This calls loadVariables through the form movieclip sending all variables saved in that movieclip to email.php using the POST method. Because all the text fields in form have variables associated with them, this effectively sends all information filled out in those fields to the email PHP page. From that PHP page, the sent information can be retrieved using each field’s var name. One thing to be cautious of is that you need to make sure the movieclip you are using loadVariables with exists long enough for it to send its variables to the URL specified. Because this mailer has a thank you screen after sending an email, you’ll need to wait until Flash does that before showing that screen and losing the form movieclip.

Download pdf How to Create a Flash Form with PHP