# All objects in array aligned

**URL:** <https://forum.kirupa.com/t/all-objects-in-array-aligned/274709>\
**Category:** Uncategorized\
**Created:** [November 3, 2008, 1:29pm UTC](https://forum.kirupa.com/t/all-objects-in-array-aligned/274709 "2008-11-03T13:29:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhnh](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@bhnh](https://forum.kirupa.com/u/bhnh)\
**Post date:** [November 3, 2008, 1:29pm UTC](https://forum.kirupa.com/t/all-objects-in-array-aligned/274709/1 "2008-11-03T13:29:15Z")

</div>

I have five objects that have been pushed into the array **allPieces**. When _all_ five objects are in the same spot - **LocX,LocY** -, I’d like to trace the message DONE. I tried the following…

```auto

for(var i in allPieces){
    if((allPieces*.x == LocX)&&(allPieces*.y == LocY)){*
* trace("DONE");*
* }*
*}*

```

\*… but what happens is that if _any_ of the objects is at LocX,LocY, I get the DONE message. Can anyone tell me what I’m missing? Many thanks!
