Making a combo box editable clears the combo box text field. It also sets the selected index (and
item) to
undefined
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 = 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
The first usage example uses an
instance. The keyword
component instance. For example, the following code, attached to the ComboBox instance
, sends "_level0.myBox" to the Output panel:
myBox
on(enter){
trace(this);
}
. To make a combo box editable and still retain the selected item, use the
myComboBox
.
TextInput.enter
handler and must be attached directly to a ComboBox
on()
, used in an
this
editable:
handler attached to a component, refers to the
on()
ComboBox component
193
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?