# Editing Multidimensial Arrays

**URL:** <https://forum.kirupa.com/t/editing-multidimensial-arrays/182506>\
**Category:** flash\
**Created:** [March 18, 2006, 11:53pm UTC](https://forum.kirupa.com/t/editing-multidimensial-arrays/182506 "2006-03-18T23:53:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RavenStorm](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@RavenStorm](https://forum.kirupa.com/u/RavenStorm)\
**Post date:** [March 18, 2006, 11:53pm UTC](https://forum.kirupa.com/t/editing-multidimensial-arrays/182506/1 "2006-03-18T23:53:11Z")

</div>

Alright,

Today, ladies and gentlewomen, I’m trying to create a multidimensional array that will act as a sort of Archive.

I have 3 different values that are assigned to a single-dimensional array. This array, called currentarray, is very dynamic and changes often. But now I want to create a whole new array while saving the information from the first array, and then I want to be able to switch in between both arrays, loading them up, changing them, saving the information into the Archive array.

So basically, the Archive array must eventually look something like this:

archivearray = [[item1, item2, item3], [item1, item2, item3]]

Since I want to shorten the code as much as possible, I made it so that Item3 in the archivearray is the position of that group of items. In English, that means that the Archive array would be like this:

archivearray = [[item1, item2, 0], [item1, item2, 1]]

Still with me? Good. So my code right now is this:

archivearray[currentarray[2]] = currentarray

For some reason, this totally doesn’t work. Help? Sorry if I’m too confusing.

---

<div class="post-metadata">

**Author:** ![KyoKusanagi](https://avatars.discourse-cdn.com/v4/letter/k/bc79bd/32.png) [@KyoKusanagi](https://forum.kirupa.com/u/KyoKusanagi)\
**Post date:** [March 19, 2006, 3:43am UTC](https://forum.kirupa.com/t/editing-multidimensial-arrays/182506/2 "2006-03-19T03:43:19Z")

</div>

```auto
var myArray:Array = [[1, 2, 3], [2, 4, 6]];
myArray[1][0] = 22;

trace(myArray[1][0]); //traces 22
trace(myArray[**(**myArray[0][0]**)**][0]); //traces 22 as well

```

---

<div class="post-metadata">

**Author:** ![sed\_thh](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@sed\_thh](https://forum.kirupa.com/u/sed_thh)\
**Post date:** [March 19, 2006, 1:23pm UTC](https://forum.kirupa.com/t/editing-multidimensial-arrays/182506/3 "2006-03-19T13:23:31Z")

</div>

I prefer using bunch of mc’s than matrices, it’s faster

---

<div class="post-metadata">

**Author:** ![RavenStorm](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@RavenStorm](https://forum.kirupa.com/u/RavenStorm)\
**Post date:** [March 19, 2006, 6:40pm UTC](https://forum.kirupa.com/t/editing-multidimensial-arrays/182506/4 "2006-03-19T18:40:33Z")

</div>

@KyoKusanagi: Traces: undefined, undefined. Forgot to mention I’m using Flash MX.

---

<div class="post-metadata">

**Author:** ![KyoKusanagi](https://avatars.discourse-cdn.com/v4/letter/k/bc79bd/32.png) [@KyoKusanagi](https://forum.kirupa.com/u/KyoKusanagi)\
**Post date:** [March 20, 2006, 12:54am UTC](https://forum.kirupa.com/t/editing-multidimensial-arrays/182506/5 "2006-03-20T00:54:10Z")

</div>

exported for Flash 6.0 in AS 1.0, worked fine.

```auto
var myArray = [[1, 2, 3], [2, 4, 6]];
myArray[1][0] = 22;

trace(myArray[1][0]); //traces 22
trace(myArray[(myArray[0][0])][0]); //traces 22 as well

```
