Basic Tutorial

The tutorial will show how to create a form in Flash using the EZform component. This tutorial consists of 5 easy steps:

  1. Dragging and dropping elements

  2. Setting instances and groupNames

  3. Upload PHP files

  4. Setting EZform parameters

  5. Add actionscript to SUBMIT button
     

1) DRAGGING AND DROPPING ELEMENTS:
Drag and drop the standard form components onto the stage in order to create a form similar to the one shown below (if you don't know how to create a form such as the one below, see
this page). After that, drag and drop the EZform Component onto the stage (choose EZform-HTML for HTML result emails or EZform-TEXT for text result emails).
 


EXAMPLE OF FLASH FORM:
 
YOUR FORM RESULTS EMAIL WILL LOOK LIKE THIS:

TOP

2) SETTING INSTANCES AND GROUPNAMES
For each of the form elements, you need to give it an instance name (except for radio buttons). The name that you choose will be the name that appears in the form response email. For example: For the field called "Name", the instance name should be called "Name".

For radio buttons (e.g. "male" option): Set the "groupName" as shown below
.

For the EZform component, give it the instance name "myForm"
 

SETTING AN INSTANCE NAME FOR ANY FIELD (except radio buttons):

SETTING GROUPNAMES (only for radio buttons):

TOP


3) UPLOAD PHP FILES

If you will be accessing the same webserver for multiple forms, it's only necessary to upload the PHP files once as the same PHP file will be used for all the forms. Decide on a location on your webserver that is accessible from within a browser - usually either the same location that you would upload your HTML and SWF files to or in a folder under that location.

Upload the PHP files that were included with your download (upload in ASCII mode).

Note: If you have PHP 3 installed on your webserver, you should upload the PHP 3 files instead (these files end in the .php3 extension).

TOP

4) SETTING EZFORM PARAMETERS
Select the EZform component that is on the stage and set the properties in the Component Inspector panel as follows (
the email addresses and URL's specified in these examples are for demonstration purposes only).
 

Property Name
Description
Example
Required
PHP File

Name and location of PHP file

* See note below

HTML RESULT EMAIL:
http://www.yourUrl.com/forms/formhtml.php

TEXT RESULT EMAIL:
forms/formtext.php

*
Recipient Email

The email address that the form results should be sent to.

yourName@yourEmail.com

NOTE: Multiple addresses can be specified, separated with commas.

*
Subject Text that will appear in the subject field Your feedback form message
From Name The name that should appear in the from field of the form results email. My Form (can be set dynamically to match the name of the person sending the form)
*
From Email The email address that the form results email was sent from. me@myemail.com (can be set dynamically to match the name of the person sending the form)
*

* Note: It is advisable to use the full URL of the formhtml.php or formtext.php files only when testing the form. When you are ready to make the form live, it's best to change this to a relative path. For example: "forms/formhtml.php". This is due to the security features of the Flash Player which may prevent the PHP file from being accessed from www.yoururl.com if a user visits your site without entering the "www". See the section on Flash Player Security for tips and information.

TOP

5) ADD ACTIONSCRIPT TO SUBMIT BUTTON
The technique for coding your button depends on the version of Actionscript you are using. If you are using Actionscript 1 copy and paste the following code into this button:

on(release) {
  myForm.submitForm();
}

Note: If you are using the button component, you should use the following submit action instead:

on(release) {
  _parent.myForm.submitForm();
}

If you are using Actionscript 2, you should add your code to the timeline instead of the symbol. Copy and paste the following code onto your timeline (this code assumes your button has the instance name 'myButton', without the quotes):

myButton.onRelease = function() {
  _parent.myForm.submitForm();
}

Alternately if you are using Actionscript 3, you should use code something like the following (this code assumes your button has the instance name 'myButton', without the quotes):

import flash.events.MouseEvent;
myButton.addEventListener(MouseEvent.CLICK, onMouseClick);
function onMouseClick(eo:MouseEvent):void {
  myForm.submitForm();
}

TOP

The form is now ready!

Note: If you uploaded the php file to a remote webserver, you will require an Internet connection to test this.