ComboBox.textField

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX 2004.

Usage

comboBoxInstance.textField

Description

Property (read-only); a reference to the TextInput component contained by the ComboBox component.

This property lets you access the underlying TextInput component so that you can manipulate it. For example, you might want to change the selection of the text box or restrict the characters that can be entered in it.

Example

The following code restricts the text box of myComboBox so that it only accept numbers to maximum of six characters:

// Add Items to List.
my_cb.addItem({data:0xFFFFFF, label:"white"});
my_cb.addItem({data:0x000000, label:"black"});

my_cb.editable = true;

// Restrict what can be entered into textfield to only 0-9.
my_cb.restrict = "0-9";

// Limit input to 6 characters.
my_cb.textField.maxChars = 6;