<s:ComboBox id=”myCB” width=”140″ color=”#000000″ requireSelection=”true”>
<s:dataProvider>
<mx:ArrayList>
<fx:String>Red</fx:String>
<fx:String>Orange</fx:String>
<fx:String>Yellow</fx:String>
<fx:String>Blue</fx:String>
<fx:String>Green</fx:String>
</mx:ArrayList>
</s:dataProvider>
</s:ComboBox>
Spark combobox shows value corresponding to selected index 4 but does not work with selected index 0 on down/up arrow key in dropdown
It is an issue in Flash builder 4.1.0 sdk and solved in 4.5 sdk.
ComboBox.as
override mx_internal function changeHighlightedSelection(newIndex:int, scrollToTop:Boolean = false):void
{
super.changeHighlightedSelection(newIndex, scrollToTop);
if (newIndex > 0)// new Index is not checked for 0th index
{
var item:Object = dataProvider ? dataProvider.getItemAt(newIndex) : undefined;
if (item)
{
var itemString:String = itemToLabel(item);
textInput.selectAll();
textInput.insertText(itemString);
textInput.selectAll();
userTypedIntoText = false;
}
}
}
In Flash builder 4.5 they solved by changing condition if (newIndex >= 0).
Found by Shailesh Kadam

