13.2. Adding a Password Form Control

Problem

You want to add a form control that allows the user to input a password value (or something like a credit card number) that cannot be read by others who can see the computer screen.

Solution

Use a TextInput component with the password parameter set to true, or use an input text field with the line type set to password.

Discussion

Typically, you want to design a form so that potentially sensitive information cannot be easily read by others in the same room as the user. Password and credit card numbers are two of the most common examples of this type of information. The conventional solution is to use what is known as a password form control. The password form control allows the user to input their information, but rather than displaying the information in plain text, it is represented by asterisks. This device lets the user to know that the computer is responding to their input, but it does not permit passersby to read the information. Even though the information does not display in clear text on the screen, it is stored within Flash in the correct format so that it can be utilized by the program.

You can create a password form control in two ways. These two ways are really just slight variations on the standard, single-line text form control discussed in Recipe 13.1. Both the input text field and the TextInput component allow you to change a single parameter to convert them into a password form control.

With a TextInput component, all you need ...

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.