# && doubt

**URL:** <https://forum.kirupa.com/t/doubt/264636>\
**Category:** flash\
**Created:** [June 28, 2008, 12:05am UTC](https://forum.kirupa.com/t/doubt/264636 "2008-06-28T00:05:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![suvenier](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@suvenier](https://forum.kirupa.com/u/suvenier)\
**Post date:** [June 28, 2008, 12:05am UTC](https://forum.kirupa.com/t/doubt/264636/1 "2008-06-28T00:05:36Z")

</div>

hi

isnt this:

```auto

    if(!land.hitTestPoint(castx,casty,true))
    {
     if(!land.hitTestPoint(castx,castyc,true))
     {
      if( !land.hitTestPoint(castx,castyb,true))
      {
                   hero.x += speedx;
      }
     }
    }

```

suposed to equal this:

```auto

if(!land.hitTestPoint(castx,casty,true) && !land.hitTestPoint(castx,castyc,true)&& !land.hitTestPoint(castx,castyb,true))
    {
        hero.x += speedx;
    }

```

im getting erratic results from the second example.

you know why?

thank you.

---

<div class="post-metadata">

**Author:** ![suvenier](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@suvenier](https://forum.kirupa.com/u/suvenier)\
**Post date:** [June 28, 2008, 11:57am UTC](https://forum.kirupa.com/t/doubt/264636/2 "2008-06-28T11:57:16Z")

</div>

> [@theclincher;2350479](#):
>
> put a space between your second condition and &&

thank you, that worked.

can you explain what’s the difference of not having a space?

---

<div class="post-metadata">

**Author:** ![McGuffin](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mcguffin/32/408_2.png) [@McGuffin](https://forum.kirupa.com/u/McGuffin)\
**Post date:** [June 28, 2008, 1:27pm UTC](https://forum.kirupa.com/t/doubt/264636/3 "2008-06-28T13:27:18Z")

</div>

The ActionScript parser steps through the spaces. Without the space there, it can’t see the logical AND (&&), and therefore skips over it, and your comparison falls on its \*\*\*. Outside of that, it probably ruins your hittest as well 🙂

Happy coding 🙂

---

<div class="post-metadata">

**Author:** ![suvenier](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@suvenier](https://forum.kirupa.com/u/suvenier)\
**Post date:** [June 28, 2008, 9:41pm UTC](https://forum.kirupa.com/t/doubt/264636/4 "2008-06-28T21:41:23Z")

</div>

thank you.
