Combobox stops propagation of the keyboard event. Go with your original but do this in content.mxml
content.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyboard, true); From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of schneiderjim Sent: Monday, November 10, 2008 7:16 AM To: [email protected] Subject: [flexcoders] Re: Custom combobox even propagation I'll admit that I'm not sure you mean by the "capture phase". I can tell you what else I did. In the customer comboxbox constructor, I did add this (pseudo code): public MyComboBox () : void { component = new ComboBox(); component.addEventListener(Keyboard.KEY_DOWN, handleIt); } private function handleIt(event:KeyboardEvent) : void { Alert.show("Here"); } And I did get the keyboard event when I pressed my function key. However, it never seemed to bubble back up to where I really wanted to handle it. I looked at the properties of the keyboard event and bubbling was true. --- In [email protected]<mailto:flexcoders%40yahoogroups.com>, Alex Harui <[EMAIL PROTECTED]> wrote: > > Try listening in capture phase > > From: [email protected]<mailto:flexcoders%40yahoogroups.com> > [mailto:[email protected]<mailto:flexcoders%40yahoogroups.com>] On Behalf Of schneiderjim > Sent: Sunday, November 09, 2008 4:10 PM > To: [email protected]<mailto:flexcoders%40yahoogroups.com> > Subject: [flexcoders] Re: Custom combobox even propagation > > > Thanks, but I'm not looking to capture "normal" keyboard entries in > the combobox. I'm looking for a hotkey/function key press that tells > our system to go do stuff on the fields in the custom form. This > hotkey/function key event propagates just fine from all of my other > custom control "wrappers", just not the combobox wrapper. > > Any other thoughts anyone? > > --- In [email protected]<mailto:flexcoders%40yahoogroups.com><mailto:flexcoders%40yahoogroups.com>, "valdhor" <stevedepp@> wrote: > > > > I have no idea about your specific problem but I do have an idea. > > > > Instead of a ComboBox, you may like to use an AutoComplete Input: > > > > > http://www.websector.de/blog/2008/04/30/quick-tip-avoid-issues-using-adobes-autocomplete-input-component-using-flex-3/ > > > > > > --- In [email protected]<mailto:flexcoders%40yahoogroups.com><mailto:flexcoders%40yahoogroups.com>, "schneiderjim" <jschneider@> wrote: > > > > > > Flex 2.0.1 > > > > > > We are dynamically generating/building a form and putting it in a > > > "content area". The form has a list of fields that are custom fields > > > (wrappers for the real UI component). I'm trying to capture a key > > > press in the content area. It works for the "TextInput" custom > > > component, but not the ComboBox. Any Ideas? Here's the basic class > > > structure (pseudo-code): > > > > > > ----------------------- > > > > > > class BaseControl extends UIComponent { > > > protected var component : UIComponent; > > > } > > > > > > class MyComboBox extends BaseControl { > > > public MyComboBox () : void { > > > component = new ComboBox(); > > > } > > > } > > > > > > class MyTextInput extends BaseControl { > > > public MyTextInput () : void { > > > component = new TextInput(); > > > } > > > } > > > > > > class MyForm extends UIComponent { > > > var fields : ArrayCollection; // list of BaseControls > > > } > > > > > > Content.mxml: > > > > > > <script> > > > var form = new MyForm(); > > > ... add form fields > > > content.addChild(form); > > > > > > content.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyboard); > > > > > > private function handleKeyboard(event:KeyboardEvent) { > > > Alert.show("Key down"); > > > } > > > </script> > > > <mx:VBox id="content"> > > > </mx:VBox> > > > > > > -------------------- > > > > > > The problem is that the keyboard handler is being called correctly > > > when a key is pressed with the cursor in the custom Text input field, > > > but is not getting called when the custom ComboBox has focus and a key > > > is pressed. > > > > > > What am I missing? > > > > > >

