13.9. Adding a Form Control for Collecting Date Information

Problem

You want to add a form control that allows the user to input a date (year, month, and day).

Solution

Use a DateField or DateChooser component (available only in Flash Professional). Alternatively, use a form control for allowing the user to input text and restrict the allowable characters.

Discussion

Flash Professional includes many components that are not part of the standard version, among which are the DateField and DateChooser components. These two components provide you with a convenient way of prompting a user to input a date value. A date chooser displays a calendar (one month at a time) from which the user can select a date. A date field is a slight variation on the date chooser. In fact, you’ll notice that the date field actually includes a nested date chooser. However, a date field doesn’t require you to display the calendar at all times. Instead, the nested date chooser is hidden except when the user is actively selecting a date. Otherwise, all that the user sees is a field (similar to a text input) with a small button to the right from which the user can open and close the nested date chooser. The date field is often more appropriate when space is a consideration.

You can create a date field or a date chooser by dragging an instance from the Component Inspector panel onto the stage and giving it an instance name via the Property inspector. Both component types have the same set of parameters that you can configure. ...

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.