# comboBox and focus issue

**URL:** <https://forum.kirupa.com/t/combobox-and-focus-issue/267752>\
**Category:** flash\
**Created:** [August 5, 2008, 11:57am UTC](https://forum.kirupa.com/t/combobox-and-focus-issue/267752 "2008-08-05T11:57:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerryj](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jerryj](https://forum.kirupa.com/u/jerryj)\
**Post date:** [August 5, 2008, 11:57am UTC](https://forum.kirupa.com/t/combobox-and-focus-issue/267752/1 "2008-08-05T11:57:10Z")

</div>

Hi,

```
 to get the focus back on the stage (and my KeyboardEvent) again,

```

on closing a comboBox I 've put

```auto
stage.focus = this

```

```
in the listener for the close event of the comboBox.

Although it works, it also gives the error:

The supplied DisplayObject must be a child of the caller.

And I'm wondering why the listener gets called twice!?

```

```auto

    cComboBox.addEventListener(Event.OPEN, openComboBoxListener);
     cComboBox.addEventListener(Event.CLOSE,closeComboBoxListener);
     
     
     stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
     
     function openComboBoxListener(e:Event):void {
          
         trace("open");
         
     }
     
     function closeComboBoxListener(e:Event):void {
         
         stage.focus= this;//errors: The supplied DisplayObject must be a child of the caller.
         trace("close");//outputs twice "close"
         
     }
     
     
     function keyPressed(e:KeyboardEvent):void {
         
         trace("pressed: "+e.keyCode);
         
     }

```

```
thanks,

Jerryj.
```
