# Splicing and Objects don't mix

**URL:** <https://forum.kirupa.com/t/splicing-and-objects-dont-mix/203312>\
**Category:** flash\
**Created:** [October 10, 2006, 3:00am UTC](https://forum.kirupa.com/t/splicing-and-objects-dont-mix/203312 "2006-10-10T03:00:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DesignerScott](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/designerscott/32/2833_2.png) [@DesignerScott](https://forum.kirupa.com/u/DesignerScott)\
**Post date:** [October 10, 2006, 3:00am UTC](https://forum.kirupa.com/t/splicing-and-objects-dont-mix/203312/1 "2006-10-10T03:00:08Z")

</div>

While trying to pass objects back and forth between two arrays, I discovered a problem (after a long time of debugging). Here’s the simplified code with the last line being the problem

```auto
var one_arr:Array = [];
var two_arr:Array = [];
var temp_obj = {
 test: 'value'
};
one_arr.push(temp_obj);
trace(one_arr[0]);//outputs ' [object Object] '
trace(one_arr[0].test);// outputs ' value '
two_arr.push(one_arr.splice(0,1) );
trace(two_arr[0]);//outputs ' [object Object] '
trace(two_arr[0].test);//outputs ' undefined ' ////Would like it to trace ' value ' though

```

Why do the contents of the object get dropped ?  
How can I work around this ?  
Thanks in advance
