title: Flex 3 scrollToIndex Help
body: <p>I'm attempting to search a combobox based on text entered via a keyboard event. The search is working and the correct result is being selected but I can't seem to get the scrollToIndex to find the correct item which should be the found result (i). It's scrolling to the last letter entered which I believe is the default behavior of a combobox. I think I'm referring to the event target incorrectly. Newbie tearing my hair out. Can you help? Thank you. Here's the function:</p>
  
  <pre><code>private function textin(event:KeyboardEvent):void 
  {
  
  var combo:ComboBox = event.target as ComboBox;
  
  var source:XMLListCollection = combo.dataProvider as XMLListCollection;
  
  str += String.fromCharCode(event.charCode);
  
  if (str=="") {
    combo.selectedIndex = 0;
  }
  
  for (var i:int=0; i&lt;source.length; i++) {
  
      if ( source[i].@name.match(new RegExp("^" + str, "i")) ) {
       combo.selectedIndex = i;
       event.target.scrollToIndex(i);
       break;
      }
  
  }
  }
  </code></pre>
  
  <p>Control: </p>
  
  <pre><code>&lt;mx:ComboBox keyDown="textin(event);" id="thislist" change="processForm();" dataProvider="{xmllist}"/&gt;
  </code></pre>