# HitTest on mc doesn't work with scrollRect!

**URL:** <https://forum.kirupa.com/t/hittest-on-mc-doesnt-work-with-scrollrect/205442>\
**Category:** Uncategorized\
**Created:** [October 29, 2006, 7:43pm UTC](https://forum.kirupa.com/t/hittest-on-mc-doesnt-work-with-scrollrect/205442 "2006-10-29T19:43:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlashAlison](https://avatars.discourse-cdn.com/v4/letter/f/82dd89/32.png) [@FlashAlison](https://forum.kirupa.com/u/FlashAlison)\
**Post date:** [October 29, 2006, 7:43pm UTC](https://forum.kirupa.com/t/hittest-on-mc-doesnt-work-with-scrollrect/205442/1 "2006-10-29T19:43:44Z")

</div>

I have two pieces of code, that won’t work together…

First: this makes a hitTest on an mc to make it run on rollover:

```auto
 onClipEvent (enterFrame) {
 if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
  if (this._currentframe<this._totalframes) {
   nextFrame();
  }
 } else {
  if (this._currentframe>1) {
   prevFrame();
  }
 }
}

```

This works - until I put the next part of code inside to make the parent mc scroll:

```auto
 web_slide.scrollRect={x:0,y:0,width:250,height:104}
btn_up.onRelease = function () {
 if (web_slide.scrollRect.y = web_slide.scrollRect.y ) {
  
 var newpos=web_slide.scrollRect
 newpos.y-=53
 web_slide.scrollRect=newpos }}
btn_down.onRelease = function () {
 if (web_slide.scrollRect.y = web_slide.scrollRect.y - 106 ) {
  
 var newpos=web_slide.scrollRect
 newpos.y+=53
 web_slide.scrollRect=newpos }}

```

Each work seperately, but they won’t together. How do I get around this?
