# Trouble with 2-D Array data storage

**URL:** <https://forum.kirupa.com/t/trouble-with-2-d-array-data-storage/189152>\
**Category:** Uncategorized\
**Created:** [May 14, 2006, 12:27pm UTC](https://forum.kirupa.com/t/trouble-with-2-d-array-data-storage/189152 "2006-05-14T12:27:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheRiddler](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@TheRiddler](https://forum.kirupa.com/u/TheRiddler)\
**Post date:** [May 14, 2006, 12:27pm UTC](https://forum.kirupa.com/t/trouble-with-2-d-array-data-storage/189152/1 "2006-05-14T12:27:49Z")

</div>

Hey guys,

In the XML-powered portfolio I’m working on, I’d like the ability to select between multiple full-size images of a particular project. Since the number of images varies between projects, I thought it’d be best to use a 2-D array, with the first dimension holding which project it is and the second holding the pictures that pertain to that project. To illustrate:

Project 0: pic1, pic2, pic3  
Project 1: pic1, pic2  
Project 2: pic1, pic2, pic3, pic4  
etc…

Here’s the non-functional code I have so far (I’m sorry for how far you’ll probably have to scroll):

```auto
xmlNode = this.firstChild; //points us at the first child of the XML file...
testSecondDimXML = []; //intermediate array that holds project number, and references? Not quite sure, yet... 
fullSizeXML = []; //holds references to full-size pics of the thumbnails retrieved from XML file
projects = []; //holds actual movieclips
		
var totalProjects = xmlNode.childNodes.length;

for (i = 0; i < totalProjects; i++) 
{
		for(var t = 0; t < xmlNode.childNodes*.childNodes[2].childNodes.length; t++)
		{
		        testSecondDimXML[t] = xmlNode.childNodes*.childNodes[2].childNodes[t].firstChild.nodeValue;
		}
		fullSizeXML** = testSecondDimXML*;
}

```

So have I gone about this all wrong, or what? I don’t really want to have to use any more than 2 arrays for the job of holding the multiple pictures; I’d like it as simple as possible.

Any help would be appreciated.

Thanks in advance,  
TheRiddler
