# Can this code be shorter (hitTesting multiple MCs)?

**URL:** https://forum.kirupa.com/t/can-this-code-be-shorter-hittesting-multiple-mcs/198821
**Category:** flash
**Created:** [August 28, 2006, 11:19pm UTC](https://forum.kirupa.com/t/can-this-code-be-shorter-hittesting-multiple-mcs/198821 "2006-08-28T23:19:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![LittleFenris](https://avatars.discourse-cdn.com/v4/letter/l/b5ac83/32.png) [@LittleFenris](https://forum.kirupa.com/u/LittleFenris)
#### Post date: [August 28, 2006, 11:19pm UTC](https://forum.kirupa.com/t/can-this-code-be-shorter-hittesting-multiple-mcs/198821/1 "2006-08-28T23:19:23Z")

</div>

As you can see from the below code, I am reversing a characters movement when they hit the hitSpot\_mc or the hitSpot2\_mc movieclips. I was wondering if there was a cleaner way to target multiple movieclips similar to this but in a “cleaner” way? The lines would get REALLY long if I have a bunch of different objects that need to stop the character. This is just for the character moving up…I have the same basic lines for the other 3 directions.

```auto
if ((fenrisDirection == "up") && (this.fenri****Area_mc.hitTest(scene_mc.hitSpot_mc))||(fenrisDirection == "up") && (this.fenri****Area_mc.hitTest(scene_mc.hitSpot2_mc))) {
		_root.scene_mc._y -= speed;
		_root.hitSpot_mc._y -= speed;
	}

```

Basically I want to know if I can target multiple MovieClips w/o having to right out that whole line of hitTest code for every object (hitSpot1, hitSpot2, etc…) inbetween || those?

I can post a link to the actual swf on a webpage so you can see how it works.

edit: those \*\*\*\* seem to be the site filtering out what it sees as a cuss word…its “s H i t” all together not that it matters for my question.
