In the following working example the list's selected index is supposed to reset to 0 whenever the text box changes.
However, for some odd reason every other keystroke the selected item disappears and then reappears at the subsequent keystroke.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Script>
<![CDATA[
import mx.collections.ArrayList;
import mx.core.UIComponent;
import mx.events.FlexEvent;
import spark.effects.Scale;
import spark.events.TextOperationEvent;
[Bindable]
public var items : ArrayList;
protected function textinput1_changeHandler(event:TextOperationEvent):void
{
items = new ArrayList(input.text.split(" "));
list.selectedIndex = 0;
}
]]>
</fx:Script>
<s:TextInput x="165" y="124" change="textinput1_changeHandler(event)" id="input" text="a few words"/>
<s:List x="165" y="184" width="433" height="291" dataProvider="{items}" id="list"></s:List>
</s:Application>