# as2 multidimensional array in external .as file

**URL:** <https://forum.kirupa.com/t/as2-multidimensional-array-in-external-as-file/304768>\
**Category:** flash\
**Created:** [February 13, 2010, 2:31pm UTC](https://forum.kirupa.com/t/as2-multidimensional-array-in-external-as-file/304768 "2010-02-13T14:31:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![charco](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@charco](https://forum.kirupa.com/u/charco)\
**Post date:** [February 13, 2010, 2:31pm UTC](https://forum.kirupa.com/t/as2-multidimensional-array-in-external-as-file/304768/1 "2010-02-13T14:31:16Z")

</div>

Hi there…  
Gotta problem with a multidimensional array. It works when included in the actionscript but not when included in an external .as file accessed through #include  
the actionscript (in the actual flash doc of course)

```auto

#include "as/datafiles.as"

```

```auto

var elms = new Array();
for (var i = 0; i<=14; i++) {
 elms.push(new Array());
}
elms[0] = new Array('hydrogen', 'H', 1, 1.01, 1, 'Humphrey Davy', 1702);
elms[1] = new Array('helium', 'He', 2, 4.01, 2, 'Helios', 1835);

```

Using a trace statement

```auto

trace(elms[0][1]);

```

brings up ‘undefined’ when the code is placed in an external (“as/datafiles.as”) actionscript file, but works OK in the actionscript.  
Any ideas?
