Flex 2.0.1
I am trying to capture keystrokes in the keyDownHandler of a
ComboBox and it appears to be firing twice for each keystroke.
Any ideas on what might cause this?
The code below works except that when the user strikes a <backSpace>
it removes two characters from _typedText.
Paul
override protected function textInput_changeHandler
(event:Event):void
{
_typedText += this.textInput.text;
if (!findFirstItem(_typedText))
{
_typedText = _typedText.substr
(0,_typedText.length -1);
findFirstItem(_typedText);
}
}
override protected function keyDownHandler
(event:KeyboardEvent):void
{
if(!event.ctrlKey)
{
if (event.keyCode ==
Keyboard.BACKSPACE || event.keyCode == Keyboard.DELETE)
{
_typedText =
_typedText.substr(0,_typedText.length -1);
findFirstItem(_typedText);
}
}
}