# Array with 2 string values per row, indexOf problem!

**URL:** https://forum.kirupa.com/t/array-with-2-string-values-per-row-indexof-problem/332041
**Category:** flash
**Created:** [January 7, 2014, 7:38pm UTC](https://forum.kirupa.com/t/array-with-2-string-values-per-row-indexof-problem/332041 "2014-01-07T19:38:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nightkarnation](https://avatars.discourse-cdn.com/v4/letter/n/a5b964/32.png) [@nightkarnation](https://forum.kirupa.com/u/nightkarnation)
#### Post date: [January 7, 2014, 7:38pm UTC](https://forum.kirupa.com/t/array-with-2-string-values-per-row-indexof-problem/332041/1 "2014-01-07T19:38:18Z")

</div>

Hey guys, here’s a simple example of an array that has 2 string values per row…  
then the 2nd array is the same but alphabetically ordered…  
Where I am stuck is when I want to grab the array value of teams using indexOf

```auto

var teams:Array = new Array();
var teamsInAlphabet:Array = new Array();
teams.push({name:"Brazil", continent:"South America"});
teams.push({name:"Germany", continent:"Europe"});
teams.push({name:"Spain", continent:"Europe"});
teams.push({name:"Italy", continent:"Europe"});
teams.push({name:"Argentina", continent:"South America"});

teamsInAlphabet = teams.concat();
teamsInAlphabet.sortOn(["name", "continent"]);

//(here's the problem) in this case I want the teams array indexOf teamsInAlphabet[0].name...
var playerTeamCorrectIndex:int = teams.indexOf(teamsInAlphabet[0].name); //INCORRECT CODE... help?
//should be something like: teams.name.indexOf(teamsInAlphabet[0].name //but with correct syntax...
trace(playerTeamCorrectIndex) //INCORRECT VALUE

```

Thanks a lot in advance!
