# (fmx) can an object have multipl hitTests?

**URL:** <https://forum.kirupa.com/t/fmx-can-an-object-have-multipl-hittests/61626>\
**Category:** flash\
**Created:** [August 20, 2004, 3:31am UTC](https://forum.kirupa.com/t/fmx-can-an-object-have-multipl-hittests/61626 "2004-08-20T03:31:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vampire](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/vampire/32/707_2.png) [@vampire](https://forum.kirupa.com/u/vampire)\
**Post date:** [August 20, 2004, 3:31am UTC](https://forum.kirupa.com/t/fmx-can-an-object-have-multipl-hittests/61626/1 "2004-08-20T03:31:19Z")

</div>

Hi all, Im only new at this so please be gentle 🙂  
Senario,  
Simple space shooter, spacecraft , enemy, style game.  
But I want to add a wall behind the spacecraft that if the enemy hits it,  
it plays the wall MC.

I have the hitTest for the enemy looking like this …

if (this.hitTest( \_root.spacecraft ) ){  
\_root.gotoAndStop ( “gameOver” );

which works if the spacecraft is hit, but Im trying to add the “wall” hitTest  
and Im haveing no luck . Ive tried many variations of…

if (this.hitTest( \_root.spaceship ) ){  
\_root.gotoAndStop ( “gameOver” );  
if (this.hitTest( \_root.wall ) ){  
\_root.gotoAndPlay ( wall (2) );

Could some one please point me in the right direction.  
Thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2004, 9:12am UTC](https://forum.kirupa.com/t/fmx-can-an-object-have-multipl-hittests/61626/2 "2004-08-20T09:12:22Z")

</div>

if (this.hitTest( \_root.wall ) ){  
\_root.gotoAndPlay ( wall (2) );  
}  
change to:  
if (this.hitTest( \_root.wall ) ){  
\_root.wall.gotoAndPlay (2);  
}
