# Arrays, fieldnames, and nesting oh my!

**URL:** <https://forum.kirupa.com/t/arrays-fieldnames-and-nesting-oh-my/245567>\
**Category:** flash\
**Created:** [November 30, 2007, 11:31pm UTC](https://forum.kirupa.com/t/arrays-fieldnames-and-nesting-oh-my/245567 "2007-11-30T23:31:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esoltas](https://avatars.discourse-cdn.com/v4/letter/e/5e9695/32.png) [@Esoltas](https://forum.kirupa.com/u/Esoltas)\
**Post date:** [November 30, 2007, 11:31pm UTC](https://forum.kirupa.com/t/arrays-fieldnames-and-nesting-oh-my/245567/1 "2007-11-30T23:31:44Z")

</div>

Thanks for even opening the post. Hopefully, you are able to help.  
My problem is that I cannot successfully transfer a value from one array to another. But wait, it’s not that simple! Because I’m making a game, I’d rather not put the actual full code up. Here’s the issue:

```auto

var firstVariable = 100;
var myArray = new Array();
myArray.push({field1: "ability", field2: firstVariable});
//And so on for other variables. trace (myArray[0].field2); returns 100.
//Now create a new array
var secondArray = new Array();
secondArray[0] = myArray[0].field2;
//Here is the problem. The above (secondArray[0]) traces to undefined!

```

Why won’t actionscript allow me to transfer the value/variable over? Better yet, how can I fix it?  
-Evan
