# Clumping things together

**URL:** <https://forum.kirupa.com/t/clumping-things-together/323386>\
**Category:** Uncategorized\
**Created:** [June 28, 2011, 5:21pm UTC](https://forum.kirupa.com/t/clumping-things-together/323386 "2011-06-28T17:21:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blargh](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Blargh](https://forum.kirupa.com/u/Blargh)\
**Post date:** [June 28, 2011, 5:21pm UTC](https://forum.kirupa.com/t/clumping-things-together/323386/1 "2011-06-28T17:21:19Z")

</div>

I have these movieclips on stage, called Seekers. What I’m trying to do is say “If these Seekers touch each other, they should clump together” Now, I have them in a larger array with other elements and also their own array.

What I tried to do was have a loop nested in a loop of two different indexes.

```auto
public function checkSmash()
        {
            var c = 0;
            var n = 0;

            while (c<seekerList.length)
            {
                if (seekerList[c] is Seeker)
                {
                    while (n<seekerList.length)
                    {

                        if (seekerList[c].hitTestObject(seekerList[n])
                        {
                            //I don't know.
                        }

                        n++;
                    }
                }
                c++;
            }
        }

```

My problem is this:  
I don’t know how to express the “clump together” part of it.  
I don’t think my double loop will work right. It would act twice for each Seeker whereas I only want it to act once.

If anyone could help me out that would be great. Thanks.
