User Guide
ComboBox component 193
Making a combo box editable clears the combo box text field. It also sets the selected index (and
item) to
undefined. To make a combo box editable and still retain the selected item, use the
following code:
var ix = myComboBox.selectedIndex;
myComboBox.editable = true; // clears the text field
myComboBox.selectedIndex = ix; // copies the label back into the text field
Example
The following code makes myComboBox editable:
myComboBox.editable = true;
ComboBox.enter
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
Usage 1:
on(enter){
// your code here
}
Usage 2:
listenerObject = new Object();
listenerObject.enter = function(eventObject){
// your code here
}
comboBoxInstance.addEventListener("enter", listenerObject)
Description
Event; broadcast to all registered listeners when the user presses the Enter key in the text box. This
event is a TextInput event that is broadcast only from editable combo boxes. For more
information, see
TextInput.enter.
The first usage example uses an
on() handler and must be attached directly to a ComboBox
instance. The keyword
this, used in an on() handler attached to a component, refers to the
component instance. For example, the following code, attached to the ComboBox instance
myBox, sends “_level0.myBox” to the Output panel:
on(enter){
trace(this);
}