# AS2:: Breaking down an array into rows

**URL:** <https://forum.kirupa.com/t/as2-breaking-down-an-array-into-rows/241333>\
**Category:** flash\
**Created:** [October 12, 2007, 9:17am UTC](https://forum.kirupa.com/t/as2-breaking-down-an-array-into-rows/241333 "2007-10-12T09:17:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lilleypants](https://avatars.discourse-cdn.com/v4/letter/l/f17d59/32.png) [@lilleypants](https://forum.kirupa.com/u/lilleypants)\
**Post date:** [October 12, 2007, 9:17am UTC](https://forum.kirupa.com/t/as2-breaking-down-an-array-into-rows/241333/1 "2007-10-12T09:17:21Z")

</div>

I have a datagrid that displays the contents of the array gotoArray\*, my only problem is that whenever an item gets added to the array the labels all go onto the same row instead of into sperate ones.

So it looks like this all on one row: Frame1, Frame2…

```auto
 
_global.gotoArray = new Array(_global.BM_array);
function dataGridFunction() {
 myDataGrid.setSize(260,115);
 
 for (i=0; i<gotoArray.length; i++) {
  trace(gotoArray*);
  myDataGrid.addItem({BookMark:gotoArray*});
 }
 myDataGrid.rowCount = gotoArray.length;
 myDataGrid.setStyle("fontFamily","Verdana");
 myDataGrid.setStyle("fontColor","0x000000");
 myDataGrid.setStyle("headerColor","0xafe5ff");
 myDataGrid.setStyle("alternatingRowColors",["0xeaeaea", "0xFFFFFF"]);
 myDataGrid.setStyle("rollOverColor","0xfffff3");
 myDataGrid.setStyle("selectionColor","0xfffff3");
 myDataGrid.setStyle("selectionDuration",300);
 gotoArray.sortOn("name",Array.CASEINSENSITIVE);
 
}
 

```

Can anyone see a simple way of doing this?

ALSO on an array note: How can I remove a value from an array according to it’s index number - do I use the slice tool??

Ta
