Dynamically Creating a 3 Dimensional Array?

:puzzled: This seemingly trivial problem is really confounding me. I have a 3 dimensional array like this …


[font=Courier New]oldmap = [[['a1',0],['a1',1]], [/font]
[font=Courier New]		 [['a0',1],['a1',0]]];[/font]

I simply want to take this array, modify the data, and create a new array. Here’s the code (minus the transform functions):


 
[font=Courier New]newmap = new Array();[/font]
 
[font=Courier New]for (i=0;i<map_height;i++) { [/font]
[font=Courier New]for (j=0;j<map_width;j++) {[/font]
 
[font=Courier New]	old_label = oldmap*[j][0];[/font]
[font=Courier New]	old_type = oldmap*[j][1];[/font]
 
[font=Courier New]	// transform the data[/font]
[font=Courier New]	new_label = transformLabel(old_label);[/font]
[font=Courier New]	new_type = transformType(old_type);[/font]
 
[font=Courier New]	state = [new_label,new_type];[/font]
 
[font=Courier New]	// THIS LINE IS NOT WORKING[/font]
[font=Courier New]	newmap*[j].push(state);[/font]
 
[font=Courier New]} // end j [/font]
[font=Courier New]} // end i[/font]
 
[font=Courier New]trace(newmap);[/font]
 

When I trace “newmap” I always get undefined.

Thanks in advance … been reading the forum for a week now … great info … good to meet you! :slight_smile: