# How to find out what number in an Array a particular element is?

**URL:** <https://forum.kirupa.com/t/how-to-find-out-what-number-in-an-array-a-particular-element-is/259182>\
**Category:** flash\
**Created:** [May 1, 2008, 7:45pm UTC](https://forum.kirupa.com/t/how-to-find-out-what-number-in-an-array-a-particular-element-is/259182 "2008-05-01T19:45:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rumblesushi](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@rumblesushi](https://forum.kirupa.com/u/rumblesushi)\
**Post date:** [May 1, 2008, 7:45pm UTC](https://forum.kirupa.com/t/how-to-find-out-what-number-in-an-array-a-particular-element-is/259182/1 "2008-05-01T19:45:39Z")

</div>

Essentially I need the MC to know whereabouts in the Array it is :beam:

Say you pick a movieclip at random, and assign in a function, how do you find out what number in the Array it is and remove it from the array?

For example…

```auto
 
for(a=0; a<arrayInQuestion.length; a++) {
if(arrayInQuestion[a]!=this) {
if(dist>50) {
arrayInQuestion.splice(this, 1)
}
}
}

```

But of course, “this” doesn’t work, so I need to find out what number “this” is 🙂

Of course, it would be easy to remove the MC that I am checking “this” for distance with, it would just be splicing array[a], but it’s “this” that I am just not sure how to splice.

Cheers,  
Joe
