# Multidimensional arrays

**URL:** <https://forum.kirupa.com/t/multidimensional-arrays/248814>\
**Category:** flash\
**Created:** [January 11, 2008, 8:58pm UTC](https://forum.kirupa.com/t/multidimensional-arrays/248814 "2008-01-11T20:58:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mx781](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@mx781](https://forum.kirupa.com/u/mx781)\
**Post date:** [January 11, 2008, 8:58pm UTC](https://forum.kirupa.com/t/multidimensional-arrays/248814/1 "2008-01-11T20:58:01Z")

</div>

I have been struggling with this problem for over 5 hours right now, and I hope that one of you guys can help me out with this.

My aim is to have a multidimensional array, that “sorts” people into categories and each category has a different member count.  
So for example, I’d want it to look like this:  
people[“generic”][#];  
And the # would be the number of a member in that category. Each member is supposedly a Loader class.  
So at the start, the array is empty and I want to add more people. I’ve got the data stored as peopleGroups[] and peopleCount[] (this isn’t the real way I have it, so don’t suggest me morphing those two into one array or something. I’m just simplifying all this.).  
So then, I would go like…

```auto

for(var i:int = 0; i<peopleGroups.length; i++)
{
for(var j:int = 0; j<peopleCount*; j++)
{
people[peopleGroups*][j] = new Loader();
}
}

```

So in my opinion that’d be correct. Well, I guess I’m not.  
TypeError: Error #1010: A term is undefined and has no properties.  
I used trace statements to check out which line is it, and it turned out to be

```auto
people[peopleGroups*][j] = new Loader();

```

.

I checked the definition of the people array.

```auto

private var people:Array = new Array(new Array());

```

_Note: It’s all the same class, so the private / public property wouldn’t change anything._

Gah. Well, I wanted to fix this of course. So I just tried tracing people[0][0]. Same error as before. So since it seems I can’t access anything of the class, whether it be using a String for the first array location, or an int, no matter.

So does anyone have suggestions for this? I would be very thankful for any help towards fixing this error and making the above loop and normal referrencing to that array possible.
