ActionScript 2.0 Components Language Reference |
|
|
|
| ComboBox component > ComboBox.textField | |||
Flash Player 6 (6.0.79.0).
Flash MX 2004.
comboBoxInstance.textField
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.
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;
|
|
|
|