Forms are the primary way of gathering user input in any type of computer application, and Flash applications are no exception. If you want to prompt the user for information such as email address, preferences, registration information, and so forth, you'll likely be using a form of one sort or another. Flash forms are typically made up of Flash components from the User Interface component set. The UI component instances are sometimes referred to as
form controls and consist of the following basic types:
Button
-
A
Button component allows the form to respond to mouse clicks. The Button component is very similar to a Button symbol in a general sense, but it is specifically designed to interact with Flash in a standardized manner.
CheckBox
-
The
CheckBox component allows the user place a checkmark in a box next to a question, which is useful for yes/no and true/false questions, for example.
ComboBox
-
A
ComboBox component is more informally referred to as a drop-down menu. Using a combo box, you can present a variety of options from which the user can select just one.
List
-
A List component is similar to a ComboBox except that the options are displayed slightly differently and you can allow the user to select more than one option.
NumericStepper
-
A
NumericStepper component allows the user to choose from a specified range of numeric values.
RadioButton
-
A
RadioButton operates somewhat similarly to a checkbox in that it can be selected or not. However, radio buttons are not really used by themselves. Typically radio buttons are grouped together to present the user with a set of possible responses from which he or she can select just one. If any one radio button in a group is selected, the others in the group are automatically deselected.
TextArea
-
The
TextArea component allows the user to input multiple lines of text. Should it be necessary, the component will automatically scroll to accommodate the text.
TextInput
-
A
TextInput component allows the user to input a single line of text. TextInput components also allow you to create password input controls.
In addition to the preceding list of components, you can also use input text fields as a way of gathering user input in a Flash form. In fact, the TextArea and TextInput components are really just fancy text fields with some extra functionality built in.
In the recipes in this chapter, you'll get a chance to familiarize yourself with the Flash form controls. You can find out how to add form controls, how to add values to them, how to retrieve values from them, and how to submit that information to a server-side script for further processingby sending an email or inserting information into a database.
|