Recipe 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 to do is select the component on the stage and change the password parameter to TRue.

For an input text field, select the instance on the stage and change the line type to password.

See Also

Recipe 13.1




Flash 8 Cookbook
Flash 8 Cookbook (Cookbooks (OReilly))
ISBN: 0596102402
EAN: 2147483647
Year: 2007
Pages: 336
Authors: Joey Lott

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net