# Mouse hitTest localToGlobal question

**URL:** https://forum.kirupa.com/t/mouse-hittest-localtoglobal-question/209273
**Category:** Uncategorized
**Created:** [December 7, 2006, 11:49am UTC](https://forum.kirupa.com/t/mouse-hittest-localtoglobal-question/209273 "2006-12-07T11:49:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![thomastraub](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/thomastraub/32/3074_2.png) [@thomastraub](https://forum.kirupa.com/u/thomastraub)
#### Post date: [December 7, 2006, 11:49am UTC](https://forum.kirupa.com/t/mouse-hittest-localtoglobal-question/209273/1 "2006-12-07T11:49:36Z")

</div>

I am loading a dropdown menu into another swf and position it on the scene. Now the hittest returns always false, because the menu coordinates have changed. I cannot figure out how to convert the coordinates.

I load the menu into menu\_mc.

The menu has the clip myMenu on the scene.  
I define the mouse listener on the scene.

In myMenu I have the clip menu\_holder into which I attach mcs for the entries.  
myMenu also holds all logic.

```auto

// loading code in the main swf

var menuPos:Object = new Object();
    menuPos.x = 0;
    menuPos.y = 0;

var menu_mc:MovieClip = createEmptyMovieClip("menu_mc", 100);
with (menu_mc){_x = menuPos.x;_y = menuPos.y};

menuLoader.loadClip( menuMoviePath, menu_mc);

// the mouse listener in the menu swf

var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {

    /*
      * I guess I have to convert the coordinates 
      * of menu_holder with localToGlobal
      * before doing the hitTest, but how ?
    /*

    var hitResult = myMenu.menu_holder.hitTest(_xmouse, _ymouse, false);
    myMenu.menuControl(hitResult);
}

```

I really appreciate Your help, I am used to coding (PHP, Javascript), but OO gives me a hard time.

Thanks, Thomas

P.S. Your site is a great help for me.
