# Trouble Nesting Array-Objects

**URL:** <https://forum.kirupa.com/t/trouble-nesting-array-objects/236321>\
**Category:** flash\
**Created:** [August 19, 2007, 9:34pm UTC](https://forum.kirupa.com/t/trouble-nesting-array-objects/236321 "2007-08-19T21:34:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxtop](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@maxtop](https://forum.kirupa.com/u/maxtop)\
**Post date:** [August 19, 2007, 9:34pm UTC](https://forum.kirupa.com/t/trouble-nesting-array-objects/236321/1 "2007-08-19T21:34:25Z")

</div>

Hi,

I’m new to Kirupa and can use some help. Here’s the situation…

I download data to my Flash app and build a data structure this…

Array[Index].propertyName

Later in the program I download more data and I create another structure just like it…

Array2[Index2].propertyName2

Now I want to add the new structure as a property to the old structure so I can reference it like this…

Array[Index].Array2[Index2].propertyName2

I know how to create this using “push”, but that technique adds a new element to the array. In this case, I don’t want to add a new element to the array. I just want to attach the second array-object to the first array as a property.

Typically, I create these structures like this:

for (i=0;i\<Array.length;i++) {  
Array\* = new Object();  
Array\*.propertyName = Value;  
etc.  
\*}

\*So I tried…

for (j=0;j\<Array2.length;j++){  
for (i=0;i\<Array1.length;i++) {  
Array2[j].Array1\* = new Object();  
Array2[j].Array1\*.propertyName = Value;  
etc.  
}  
}

But Array2[j].Array1\*.propertyName returns Undefined.

Does anyone know how I can accomplish nesting these 2 structures together?  
Thanks,  
Adam
