Alex, It appears that the 'editable' property was just a red herring. The real issue is in switching the currentState. In Flex2, I might have a comboBox defined in a different state. In the initialization method, I would switch to that state, perform the ComboBox initialization and switch back to the default state. Then later, when switching to the other state with the ComboBox, it would already be initialized.
It does not appear to work the same way in Flex3. It seems that when switching from state to state, ComboBoxes get reset. I wrote a small test application to try out this theory. Click the "Initialize" button first to set up the ComboBox, then click the Switch button to show the ComboBox. You'll see it no longer has it's value. While viewing the ComboBox, choose a different value and the Switch back and forth. The value gets lost. Here's the test app: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:states> <mx:State name="show"> <mx:AddChild position="after" relativeTo="{b_show}"> <mx:ComboBox id="cb_freight" dataProvider="{['Gordon','Alex']}" editable="true" /> </mx:AddChild> </mx:State> </mx:states> <mx:Script> <![CDATA[ private function switchStates():void{ if(currentState == 'show') currentState=''; else currentState='show'; } private function initIt():void{ currentState='show'; cb_freight.selectedIndex = -1; cb_freight.text="This is a test"; currentState=''; } ]]> </mx:Script> <mx:VBox > <mx:Button id="b_init" label="Initialize" click="initIt()" /> <mx:Button id="b_show" label="Switch" click="switchStates()" /> </mx:VBox> </mx:Application> --- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote: > > The following worked for me. If your dataProvider is assigned later > that might make a difference. > > > > var foo:ComboBox = new > ComboBox(); > > addChild(foo); > > foo.y = 100; > > foo.editable = true; > > foo.dataProvider = > ['Gordon', 'Alex']; > > foo.selectedIndex = -1; > > foo.text = "nuts"; > > > > ________________________________ > > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of Mike_Robinson_98 > Sent: Tuesday, March 25, 2008 12:08 PM > To: [email protected] > Subject: [flexcoders] Flex 3 ComboBox and Editable property > > > > Hi, > > I'm attempting to migrate from Flex2 to 3. One issue I'm have is with > the ComboBox. In particular, with the Editable property set true. > > Previously, if I wanted to set an editable combobox to display a value > OTHER than one of the values in the dataProvider (an ArrayCollection > of Strings), I just set the 'text' property to some string. In Flex3, > this does not seem to have any effect. I even added setting the > selectedIndex to -1, first but still no change. The desired text value > does not show up, just the 1st element of the dataProvider. > > cb_freight.selectedIndex = -1; > cb_freight.text = "This is a test"; > > Anyone else found this the case? >

