
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
The Flash Form Data Cycle
|
419
Flash Client-Side User Input
To supply text-based input, users enter text into on-screen text fields. In Action-
Script, an on-screen text field corresponds to an instance of the TextField class,
which we use to access the field’s data. Users can also provide input using interface
elements such as pull-down menus, radio buttons, and checkboxes. Prior to Flash
MX, these typical form elements were created from scratch by the developer. Flash
MX introduced prebuilt form widgets called the Flash UI Components: CheckBox,
ComboBox, ListBox, PushButton, RadioButton, ScrollBar, and ScrollPane. These
components are not a native part of ActionScript; they are sophisticated movie clips
that come with the Flash MX authoring tool. To learn how to use the Flash MX UI
Components, see Help
➝ Tutorials ➝ Introduction to Components Tutorial. For a
summary of the Flash UI Components’ properties and methods, see Appendix G.
Once a user’s input has been collected, it should be validated before it’s sent to the
server. This ensures that our server-side data-handling application always receives
usable data. Common validations include checking that all required fields have been
filled out and verifying that the correct type of data has been entered. For example,
an email address ...