13.18. A Feedback Form

One of the most frequent information requests from Flash developers is how to create a form that gathers user feedback and then submits it to a server-side script, which then emails that information to a specified email address. In this short program, you will create a Flash form that does just that using the FormController component along with a combo box, text input, text area, and button form control. For the server-side script, you’ll find several predefined scripts provided in the .zip file that contains the files accompanying the Flash Cookbook. You can find the Flash 8 Cookbook components at http://www.rightactionscript/fcb. One file is a PHP script named sendEmail.php. The other is a ColdFusion script named sendEmail.cfm. Select the script that your server supports and copy it to a directory that is accessible from the Web.

To build the application, complete the following steps:

  1. Open a new Flash document and save it to your local disk as FeedbackForm.fla.

  2. Open the Components panel, and locate the UI Components folder.

  3. Drag an instance of the ComboBox component from the Components panel to the stage on the main timeline. Name the component instance ccbTo using the Property inspector.

  4. With the combo box selected on the stage, open the Component Inspector panel and double-click on the Values column for the labels parameter. The combo box should allow the user to select from a list of departments such as Support, Sales, and Webmaster. When you’ve added the ...

Get Flash 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.