# Array duplicate error

**URL:** <https://forum.kirupa.com/t/array-duplicate-error/72458>\
**Category:** flash\
**Created:** [December 6, 2004, 5:46am UTC](https://forum.kirupa.com/t/array-duplicate-error/72458 "2004-12-06T05:46:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MTsoul](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@MTsoul](https://forum.kirupa.com/u/MTsoul)\
**Post date:** [December 6, 2004, 5:46am UTC](https://forum.kirupa.com/t/array-duplicate-error/72458/1 "2004-12-06T05:46:40Z")

</div>

Hey all,

I am making tetris and found an incredibly annoying bug (in Flash 5 AS).

```auto

  array1 = new Array('0','1','2','3');
  array2 = array1;
  array2[0] = 'blah';
  trace(array1[0]);

```

Now, this traces out ‘blah’. It’s supposed to trace ‘0’. I copied array2 from array1, but if I change array2, array 1 will change also. How is this possible? This is not so with variables (strings, integers), but with arrays. Is this an error or something? How can I avoid this?
