# Quite confused with this problem

**URL:** <https://forum.kirupa.com/t/quite-confused-with-this-problem/332144>\
**Category:** Uncategorized\
**Created:** [February 14, 2014, 12:00pm UTC](https://forum.kirupa.com/t/quite-confused-with-this-problem/332144 "2014-02-14T12:00:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![capdetrons](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@capdetrons](https://forum.kirupa.com/u/capdetrons)\
**Post date:** [February 14, 2014, 12:00pm UTC](https://forum.kirupa.com/t/quite-confused-with-this-problem/332144/1 "2014-02-14T12:00:02Z")

</div>

Hi, I’m trying to populate several arrays, the arrays I will use to store my player hands with the values popped out off another array but I can’t seem to see the problem.  
I’m just following the logic used to populate my previous array, the aDeck, but whenever I trace it, I get undefined. Isn’t it supposed to work identically? If I change the type to Object instead of array, I do get [Object, Object] as a response.

```auto
var aCardSuitValues:Array = ["oros", "copes", "espases", "bastos"];
var aCardValues:Array = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
var aTemp:Array = new Array();

for (i = 0; i < 4; i++)
{
	for (j = 0; j < 12; j++)
	{
		var oCard:Object = new Object();
		oCard.sCardSuit = i;
		oCard.sCardNumber = j;

		aTemp.push(oCard);
	}
}

var aDeck:Array = new Array();
while (aTemp.length > 0)
{
	var r:Number = Math.floor(Math.random() * aTemp.length);
	aDeck.push(aTemp[r]);
	aTemp.splice(r,1);
}

var aPlayer1Hand:Array = new Array();

for (k = 1; k <= 12; k++)
{
	aPlayer1Hand.push.aDeck.pop();
	trace("aPlayer1Hand =" + aPlayer1Hand);
	//trace(aCardValues[aPlayer1Hand[k].sCardNumber] + " - " + aCardSuits[aPlayer1Hand[k].sCardSuit]);
}

```
