# Problems with arrays

**URL:** <https://forum.kirupa.com/t/problems-with-arrays/214825>\
**Category:** flash\
**Created:** [February 1, 2007, 10:24am UTC](https://forum.kirupa.com/t/problems-with-arrays/214825 "2007-02-01T10:24:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pup\_100](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@Pup\_100](https://forum.kirupa.com/u/Pup_100)\
**Post date:** [February 1, 2007, 10:24am UTC](https://forum.kirupa.com/t/problems-with-arrays/214825/1 "2007-02-01T10:24:00Z")

</div>

Hi,

ActionScript Code:  
[FONT=Courier New][LEFT]pig\_array = [COLOR=#000000][[/COLOR][COLOR=#000080]1[/COLOR], [COLOR=#000080]3[/COLOR], [COLOR=#000080]7[/COLOR][COLOR=#000000]][/COLOR];\</p\>  
\<p\>cat\_array = [COLOR=#000000][[/COLOR][COLOR=#000080]4[/COLOR], [COLOR=#000080]5[/COLOR], [COLOR=#000080]7[/COLOR][COLOR=#000000]][/COLOR];\</p\>  
\<p\>flea\_array = [COLOR=#000000][[/COLOR][COLOR=#000080]1[/COLOR], [COLOR=#000080]2[/COLOR], [COLOR=#000080]3[/COLOR], [COLOR=#000080]8[/COLOR][COLOR=#000000]][/COLOR];\</p\>  
\<p\>goat\_array = [COLOR=#000000][[/COLOR][COLOR=#000080]4[/COLOR], [COLOR=#000080]6[/COLOR], [COLOR=#000080]9[/COLOR][COLOR=#000000]][/COLOR];\</p\>  
\<p\>mainHold\_array = [COLOR=#000000][[/COLOR]pig\_array, cat\_array, flea\_array, goat\_array[COLOR=#000000]][/COLOR];\</p\>  
\<p\>for [COLOR=#000000]([/COLOR]i [COLOR=#0000ff]in[/COLOR] mainHold\_array[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]\</p\>  
\<p\>for [COLOR=#000000]([/COLOR]p [COLOR=#0000ff]in[/COLOR] mainHold\_array[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]\</p\>  
\<p\>if [COLOR=#000000]([/COLOR]mainHold\_array[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR][COLOR=#000000][[/COLOR]p[COLOR=#000000]][/COLOR] == [COLOR=#000080]3[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]\</p\>  
\<p\>traceCOLOR=#000000[/COLOR];\</p\>  
\<p\>[COLOR=#000000]}[/COLOR]\</p\>  
\<p\>[COLOR=#000000]}[/COLOR]\</p\>  
\<p\>[COLOR=#000000]}[/COLOR]  
[/LEFT]  
[/FONT]

Using the above script I was expecting & wanting the trace command to give me the name of the item held at “mainHold\_array\*” in other words if mainHold\_array\* was equal to mainHold\_array[0] it would trace pig\_array. Instead of that I’m getting the VALUES of the items held at that position -1,3,7

I have tried to use the \_parent property as in mainHold\_array\*.\_parent, but nothing gives. I have even tried putting the main array in another array – masterHold\_array & then tried accessing values from there such as masterHold\_array[0], but again it will only give me the number values stored in that position – such as 1,3,7?

Any help please.
