# Hit test

**URL:** <https://forum.kirupa.com/t/hit-test/229709>\
**Category:** Uncategorized\
**Created:** [June 19, 2007, 4:55pm UTC](https://forum.kirupa.com/t/hit-test/229709 "2007-06-19T16:55:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brndn](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@brndn](https://forum.kirupa.com/u/brndn)\
**Post date:** [June 19, 2007, 4:55pm UTC](https://forum.kirupa.com/t/hit-test/229709/1 "2007-06-19T16:55:24Z")

</div>

I am just trying to put this hit test on an infinate menu so it stops at last and first images. that was cool i just killed the on enterframe.  
but stangly enough only the hit right is working.

any suggestions???

```auto
function activateMenu() {
	menu.onEnterFrame = function() {
		if(this.item == pictArray.length){
		}
			if ((_root._ymouse>=(_root.hit_right._y-40))) {
				trace("hit top");
				this._y += (speed);
			if (this._y<-sub_menu._height/3) {
				trace("up 1");
				this._y = this._y;
				delete menu.onEnterFrame;
			}
			if ((_root._ymouse>=(_root.hit_left._y-40))) {
				trace("hit new");
			}
			if (this._y>0) {
				trace("down 1");
				this._y = this._y;
				delete menu.onEnterFrame;
				his._y = -sub_menu._height/2;
		
			}
		}
	};
}

```
