# Multidimensional array question

**URL:** <https://forum.kirupa.com/t/multidimensional-array-question/294966>\
**Category:** Uncategorized\
**Created:** [August 23, 2009, 4:14pm UTC](https://forum.kirupa.com/t/multidimensional-array-question/294966 "2009-08-23T16:14:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shazzmoe](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@shazzmoe](https://forum.kirupa.com/u/shazzmoe)\
**Post date:** [August 23, 2009, 4:14pm UTC](https://forum.kirupa.com/t/multidimensional-array-question/294966/1 "2009-08-23T16:14:14Z")

</div>

The following is a snippet of code i’m using to build a multidimensional array by examining points in another. The problem as you can see here is that the new array i wish to fill “exact\_path” is being filled by arrays of size 2. But since I’m locally creating the temp array i do not know how to reset this temp array with out wiping out what has already been stored. So is there a way to push on a multidimensional array without defining it?

```auto

if(points*[0] == points[j][0]){//first compare x1 to x2
                    var y_dist:int = points*[1] - points[j][1];
                    var y_start:int = points*[1];
                    while(y_dist < 0){
                        xy_pos.push(points*[0]*32);
                        xy_pos.push(y_start*32);            
                        exact_path.push(xy_pos);
                        xy_pos.pop();
                        xy_pos.pop();
                        y_start++;
                        y_dist++;
                    }
                }

```
