# New to AS3: need help with array manipulation

**URL:** <https://forum.kirupa.com/t/new-to-as3-need-help-with-array-manipulation/250456>\
**Category:** flash\
**Created:** [January 29, 2008, 7:13pm UTC](https://forum.kirupa.com/t/new-to-as3-need-help-with-array-manipulation/250456 "2008-01-29T19:13:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lkingman](https://avatars.discourse-cdn.com/v4/letter/l/cab0a1/32.png) [@lkingman](https://forum.kirupa.com/u/lkingman)\
**Post date:** [January 29, 2008, 7:13pm UTC](https://forum.kirupa.com/t/new-to-as3-need-help-with-array-manipulation/250456/1 "2008-01-29T19:13:49Z")

</div>

In other languages, an element in a predefined array may be changed by syntax like myArray[2] = [data], changing the value of the second element to [data]. When I do this in AS3, the data is written to element two, but element 1 data seems to be lost, returning “[object] [Object]”.

I want the elements in a sharedObjects array to remain in fixed positions and change them randomly. Is push and splice the only way to manipulate the array? Is there a simpler way like myArray[2] = [data] to do it?

Thanks for any help!
