# Array.slice()

**URL:** <https://forum.kirupa.com/t/array-slice/254231>\
**Category:** Uncategorized\
**Created:** [March 10, 2008, 12:53am UTC](https://forum.kirupa.com/t/array-slice/254231 "2008-03-10T00:53:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ariff](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@Ariff](https://forum.kirupa.com/u/Ariff)\
**Post date:** [March 10, 2008, 12:53am UTC](https://forum.kirupa.com/t/array-slice/254231/1 "2008-03-10T00:53:49Z")

</div>

Hi,

i have an fileArray consisting of 6 mc’s. i have a second containerArray that consists of 3 containermcs.

i would like to obtain the following :

containerArray[0] = containerMC0;  
containerArray[1] = containerMC1;  
containerArray[2] = containerMC2;

containerMC0.addChild(fileArray[0]);  
containerMC0.addChild(fileArray[1]);

containerMC1.addChild(fileArray[2]);  
containerMC1.addChlid(fileArray[3]);

containerMC2.addChild(fileArray[4]);  
containerMC2.addChild(fileArray[5]);

im not very good at writing loops. So when this is done, i could go and say :

addChild(containerArray[0])

this would give me containerMC0 consisting of the mc’s fileArray[0] & [1]

any ideas on how i could do this ?
