# (FMX) hitTest

**URL:** <https://forum.kirupa.com/t/fmx-hittest/33985>\
**Category:** flash\
**Created:** [October 26, 2003, 1:08pm UTC](https://forum.kirupa.com/t/fmx-hittest/33985 "2003-10-26T13:08:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![luster](https://avatars.discourse-cdn.com/v4/letter/l/ec9cab/32.png) [@luster](https://forum.kirupa.com/u/luster)\
**Post date:** [October 26, 2003, 1:08pm UTC](https://forum.kirupa.com/t/fmx-hittest/33985/1 "2003-10-26T13:08:07Z")

</div>

Hi,  
does anyone know how to create an if statement like this:  
-2conditions  
-1 is a normal condition  
-2 is a condition that, if it’s fulfilled, the “if” script isn’t executed

(basically it’s just thzt the second must say " if that doesn’t hitTest)

Please reply,

Luster

---

<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:** [October 26, 2003, 1:38pm UTC](https://forum.kirupa.com/t/fmx-hittest/33985/2 "2003-10-26T13:38:35Z")

</div>

:h:

---

<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:** [October 26, 2003, 1:51pm UTC](https://forum.kirupa.com/t/fmx-hittest/33985/3 "2003-10-26T13:51:21Z")

</div>

OK, maybe that wasn’t very clear. I’ll explain it this way:

I have an if statement , with 2 conditions, simplified:

if (condition1 AND condition2)  
blablabla

condition1 is a "if Key.isDown…"  
condition2 is a hitTest of 2 MC’s

Now, I want the if-statement to execute the “blablabla” stuff if condition 1 is true ( the key is down) and if there is NO collision.  
It’s for something like this: you control an object, and there are obstacles in the way. If you drive against them, you cannot pass and you must go around.

---

<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:** [October 26, 2003, 1:52pm UTC](https://forum.kirupa.com/t/fmx-hittest/33985/4 "2003-10-26T13:52:40Z")

</div>

Are you looking for something like this?  
[AS]  
if (condition1 && !condition2) {  
doSomething();  
}  
[/AS]

Basically that says ‘if condition1 and not condition2 then do something’.

But like Voetsjoeba I’m not clear on what you want to accomplish.

---

<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:** [October 26, 2003, 2:01pm UTC](https://forum.kirupa.com/t/fmx-hittest/33985/5 "2003-10-26T14:01:22Z")

</div>

Maybe the .fla will clear it up.  
I want to move the pinguin around, but it cant go over the block, it needs to go around.

For the .fla, check this thread:  
[http://www.kirupaforum.com/forums/showthread.php?threadid=37692](http://www.kirupaforum.com/forums/showthread.php?threadid=37692)

---

<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:** [October 26, 2003, 3:19pm UTC](https://forum.kirupa.com/t/fmx-hittest/33985/6 "2003-10-26T15:19:04Z")

</div>

Anyone?I think it has something to do with the !condition thing mentioned, but how do you use that?

---

<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:** [October 27, 2003, 8:41am UTC](https://forum.kirupa.com/t/fmx-hittest/33985/7 "2003-10-27T08:41:57Z")

</div>

I’ll have a look 🙂

---

<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:** [November 1, 2003, 11:08am UTC](https://forum.kirupa.com/t/fmx-hittest/33985/8 "2003-11-01T11:08:23Z")

</div>

Anyone???
