Thank you very much Samuel! That was really helpful! :D --- In [email protected], "Samuel Reuben" <[EMAIL PROTECTED]> wrote: > > Hi Daniel, > > The combo box was not designed to do what you are trying to do. I suggest > that you use a PopUpButton with a list popped up and you can set the > allowMultipleSelection="true" for the list. You will have to handle what > happens when you make a selection(because everytime you select an item in > the list it will close the pop up). An idea would be to put the list in a > HBox and when your condition is satisfied(probably after selecting the > desired number of items) call the close() method of the popUpButton which > will close it for you. > A simple example would look like this (for this one to close you'll have to > select blue then (Ctrl+red)): > > <?xml version="1.0"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="assets.*" > backgroundColor="#FFFFFF" width="600" height="600"> > <mx:Script> > <![CDATA[ > import mx.events.*; > private var selectList:Array=new Array(); > private function listenItemSelect(event:ListEvent):void{ > ti.text=String(event.target.selectedIndices); > ti1.text=""; > for ( var i:Object in event.target.selectedIndices){ > ti1.text+=String(event.target.selectedItems[i].label)+ " "; > } > if (String(event.target.selectedIndices)=="2,1"){ > myPopUpButton.label=ti1.text; > myPopUpButton.close(); > } > } > ]]> > </mx:Script> > <mx:Button id="myButton" label="Roll over this button to close the popUp of > the PopUpButton" rollOver="myPopUpButton.close()" /> > <mx:PopUpButton id="myPopUpButton" label="{ti1.text}" > > <mx:popUp> > <mx:HBox > > <mx:List id="myList" allowMultipleSelection="true" > itemClick="listenItemSelect(event)"> > <mx:dataProvider> > <mx:Array> > <mx:Object label="Black" /> > <mx:Object label="Blue" /> > <mx:Object label="Red" /> > <mx:Object label="Yellow" /> > </mx:Array> > </mx:dataProvider> > </mx:List> > </mx:HBox> > </mx:popUp> > </mx:PopUpButton> > <mx:Spacer height="150" /> > <mx:TextInput id="ti" /> > <mx:TextInput id="ti1" text="Let's say Black" /> > </mx:Application> > > Hope this helps, > -sam > > > On 9/6/06, Daniel <[EMAIL PROTECTED]> wrote: > > > > Im trying to create a multiple-selection combobox. > > I'll appreciate any help you can give. > > Thanks in advance. > > Daniel > > > > > > >
-- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

