# Find var position in array

**URL:** <https://forum.kirupa.com/t/find-var-position-in-array/287585>\
**Category:** flash\
**Created:** [May 4, 2009, 2:04am UTC](https://forum.kirupa.com/t/find-var-position-in-array/287585 "2009-05-04T02:04:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tyg3r](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/tyg3r/32/1341_2.png) [@Tyg3r](https://forum.kirupa.com/u/Tyg3r)\
**Post date:** [May 4, 2009, 2:04am UTC](https://forum.kirupa.com/t/find-var-position-in-array/287585/1 "2009-05-04T02:04:16Z")

</div>

Hi there,

Is it possible to call a function to tell me if a var string is in my array. And if so, what position it is in?

I pictured it to look something a little like this:

```auto
var pages:Array=['index','services','about','testimonials','contact'];
var pageName:String;
	
pageName="services";

if (pageName==pages*) {
	main.gotoAndStop(*);
}

```

Cheers
