Give this a shot... It should disable new values.
<fx:Script> <![CDATA[ protected function onChanging(event:IndexChangeEvent):void { if (event.newIndex == -3) { event.preventDefault(); } } ]]> </fx:Script> <s:ComboBox changing="onChanging(event);" /> -Mark -----Original Message----- From: mark goldin [mailto:markzolo...@gmail.com] Sent: Monday, October 21, 2013 10:31 AM To: users Subject: Re: Comboox clear text No, that does not work. On Mon, Oct 21, 2013 at 4:36 AM, Kessler CTR Mark J < mark.kessler....@usmc.mil> wrote: > If your trying to prevent addition of a new item. Try the > preventDefault() from the changing event. Just check for the -3 new value. > > -Mark > > -----Original Message----- > From: mark goldin [mailto:markzolo...@gmail.com] > Sent: Saturday, October 19, 2013 7:08 AM > To: users > Subject: Comboox clear text > > I am trying to make my combobox acting as the following: > When a user enters a value that is not found in combo's data and when a > focus is moved to another control I want to clear the text that the user > just entered. Here is my code: > if (selectedIndex == -3) > { > selectedIndex = -1; > prompt = ""; > } > which works fine as long as the combo has data, but if no dataProvider has > been specified that code will not clear user's entry. What would work > is textInput.text = ""; but if I go back to the combo and try to enter > another text it will not show first character I type in. Instead, the > dropdown portion will be expended and if I continue typing then the > characters starting from second one will start appearing. > Any idea? > > Thanks >