# Child swapdepths?

**URL:** <https://forum.kirupa.com/t/child-swapdepths/249777>\
**Category:** Uncategorized\
**Created:** [January 22, 2008, 3:18pm UTC](https://forum.kirupa.com/t/child-swapdepths/249777 "2008-01-22T15:18:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xmrcivicboix](https://avatars.discourse-cdn.com/v4/letter/x/858c86/32.png) [@xmrcivicboix](https://forum.kirupa.com/u/xmrcivicboix)\
**Post date:** [January 22, 2008, 3:18pm UTC](https://forum.kirupa.com/t/child-swapdepths/249777/1 "2008-01-22T15:18:38Z")

</div>

I have a question about a child component’s hitTest. Say I have a MainCanvas component which holds ViewZero, ViewOne and ViewTwo. Further, ViewTwo holds a ComboBox (which I’m creating from scratch).

MainCanvas-

- ViewZero
- ViewOne
- ViewTwo  
-ComboBox

Within that ComBox, I have a dropdown which slides up and down. When the ComboBox is dropdown is visible, I want to test for it’s hitTest so I can close it. For example, in AS2 I can do something like this:

```auto

private function mouseDownHandler() : Void
    {
        closeOnMouseUp = isDropVisible && (!dropdownCanvas.hitTest(_level0._xmouse, _level0._ymouse, false)     
    }

private function mouseUpHandler() : Void
    {
        if (closeOnMouseUp)
            //Close the dropdown;    
    }

```
