Thursday, March 22, 2007

Flash Email Form

If you need to include an email mechanism in your Flash movie, you can use actionscript to connect your form elements to UGA's uniform mail processor.

Here is an example of a form created in Flash: emailForm.html
You can download the original Flash file here: emailForm.fla

Create your form:
  • Write your form text. This is probably directions and items that describe the input fields.
  • Create input text fields for your users to type their responses.
    • Give each input text field a unique VARIABLE name. This is the "Var:" item in properties.
    • Be sure that auto-kerning is not selected.
  • Add a submit button.

Create a Thank You page
  • This is not necessary, but it is useful if you want a degree of control for what your user sees AFTER they submit the form. This can include a simple message thanking them for their submission, or it may be a new page that you want to redirect them to after they complete a test.
  • Once you create your thank you page and post it online, note the URL. You'll need it when you add actionscript to your form.

Power your form with Actionscript:
  • Initiate your variables in the first frame and layer. In this case, the order in which you list your variables is how they will be displayed in the email. These variables are required: [see original uniform doc]. You should also list the variables for your input text fields.
  • Add the submission script to your submit button. This will be the script that POSTS the form data to the UGA server. This may include the "mailSend" variable.
    • If this form will be loaded on a web page, you may want to include a target for the post action. This target will load your thank you page in a separate window from your movie. This is important if you do not want your user to lose their place in your movie.
    • If this form is part of a Flash projector, do not include a target for the page to load. In this case, your projector will open the user's preferred web browser and load the thank you page.

Resources:
UGA EITS: Example Using Uniform
IT COE: Dr. Rieber's Survey Template

0 comments: