# hitTest on a Multi-Level Popup Menu

**URL:** <https://forum.kirupa.com/t/hittest-on-a-multi-level-popup-menu/181042>\
**Category:** flash\
**Created:** [March 5, 2006, 10:54pm UTC](https://forum.kirupa.com/t/hittest-on-a-multi-level-popup-menu/181042 "2006-03-05T22:54:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MiddleFingerMan](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@MiddleFingerMan](https://forum.kirupa.com/u/MiddleFingerMan)\
**Post date:** [March 5, 2006, 10:54pm UTC](https://forum.kirupa.com/t/hittest-on-a-multi-level-popup-menu/181042/1 "2006-03-05T22:54:08Z")

</div>

So in [this post I asked for some help](http://www.kirupa.com/forum/showthread.php?t=209696) with hitTest on a popup menu and got a perfectly working answer from TheCanadian.

I was just looking for a way to have a flyup on my menu buttons that opened on mouseOver and closed when the mouse left.

TheCanadain gave me this code and it works nicely:

```auto
onClipEvent (load) {
 newy = _y - 45;
 oldy = _y;
 vel = 15;
}
onClipEvent (enterFrame) {
 if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
  _y += (newy - _y) / vel;
 } else {
  _y += (oldy - _y) / vel;
 }
}

```

Now! I’ve got an extra spin on the menu as I need to have sub menus.

Here’s an example of the menu I’m building:

![](http://img.photobucket.com/albums/v654/lcarriere/menu.jpg)

I’ve tried a few things but am hitting a brick wall so I thought I would ask. 🙂

Any help will be greatly appreciated.
