# Cloning array

**URL:** <https://forum.kirupa.com/t/cloning-array/311476>\
**Category:** flash\
**Created:** [July 7, 2010, 6:15pm UTC](https://forum.kirupa.com/t/cloning-array/311476 "2010-07-07T18:15:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jany](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@jany](https://forum.kirupa.com/u/jany)\
**Post date:** [July 7, 2010, 6:15pm UTC](https://forum.kirupa.com/t/cloning-array/311476/1 "2010-07-07T18:15:20Z")

</div>

I have been trying for an hour to clone an array, It seems that nobody has a true reference on how to do it.

Two arrays - movieClipArray 1 and movieClipArray2

I want to duplicate movieClipArray1 entirely so that when I addChild(movieClipArray2[0]), it doesn’t take away from movieClipArray1 or reference it in any way.

I have tried the

```auto
movieClipArray2 = movieClipArray1.concat()

```

method as well as

```auto
public function cloness(source:Object):*
{
    var myBA:ByteArray = new ByteArray();
    myBA.writeObject(source);
    myBA.position = 0;
    return(myBA.readObject());
}

```

But using the concat method, it still references it for some reason, and using the other code I posted, I get back an object rather the exact duplicate of the array itself.

This is hurting my head 😟

ty for any help:rd:
