# Grabbing the position of a value in an array

**URL:** <https://forum.kirupa.com/t/grabbing-the-position-of-a-value-in-an-array/173127>\
**Category:** flash\
**Created:** [December 21, 2005, 3:05pm UTC](https://forum.kirupa.com/t/grabbing-the-position-of-a-value-in-an-array/173127 "2005-12-21T15:05:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sammo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/sammo/32/779_2.png) [@Sammo](https://forum.kirupa.com/u/Sammo)\
**Post date:** [December 21, 2005, 3:05pm UTC](https://forum.kirupa.com/t/grabbing-the-position-of-a-value-in-an-array/173127/1 "2005-12-21T15:05:43Z")

</div>

Okay, what I want is kinda hard to explain, so bear with me.

If I have an array:

```auto
myPets = ["cat", "dog", "bird", "fish"];

```

[font=Verdana]  
Now, is there any AS that can use the value of say “dog”, and return the position that “dog” is in the array, I know this seems a bit stupid and dog is obviously myPets[1], but when I’m creating arrays on the fly it becomes slightly harder.[/font]
