# Flash repeat hitTests

**URL:** <https://forum.kirupa.com/t/flash-repeat-hittests/71522>\
**Category:** Uncategorized\
**Created:** [November 25, 2004, 10:33pm UTC](https://forum.kirupa.com/t/flash-repeat-hittests/71522 "2004-11-25T22:33:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fargate](https://avatars.discourse-cdn.com/v4/letter/f/dbc845/32.png) [@Fargate](https://forum.kirupa.com/u/Fargate)\
**Post date:** [November 25, 2004, 10:33pm UTC](https://forum.kirupa.com/t/flash-repeat-hittests/71522/1 "2004-11-25T22:33:22Z")

</div>

Ok here’s the problem…I have an mc (controlled by the arrow keys) and when it intersects this other movie clip (a doorknob in this case), I have the following script:

```auto

onClipEvent (enterFrame) {
	if (this.hitTest(_root.character)) {
		if (_root.key.found == true) {
			_root.gotoAndStop(2);
		} else {
			_root.denied.nextFrame();
		}
	}
}

```

So that’s all great and wonderful…it works but here’s the problem…\_root.denied is actually a msg box that pops up if you haven’t found the key and then there’s an OK button at the bottom of it which allows the user to close the msg box. Unless I move my character AWAY from the movie clip (doorknob) it just hittested with, as soon as I press ok my character is still touching the doorknob. So flash immediately reavaluates and the msg box \_root.denied pops up again…so you pretty much can’t close it until you’ve _ **completely** _ moved the character out of the hittest area with the door knob. So what I want to know is how I can script it to only do it once and it will not pop up again at least until I have moved completely away and then back again. Basically just so it won’t keep popping up after I’ve pressed okay the first time and it’s still touching the door knob.

Thanks,

Fargate :thumb:
