# Find Cube xyz in an array of cubes

**URL:** <https://forum.kirupa.com/t/find-cube-xyz-in-an-array-of-cubes/330518>\
**Category:** flash\
**Created:** [February 2, 2013, 5:33pm UTC](https://forum.kirupa.com/t/find-cube-xyz-in-an-array-of-cubes/330518 "2013-02-02T17:33:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FJW](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@FJW](https://forum.kirupa.com/u/FJW)\
**Post date:** [February 2, 2013, 5:33pm UTC](https://forum.kirupa.com/t/find-cube-xyz-in-an-array-of-cubes/330518/1 "2013-02-02T17:33:26Z")

</div>

Hi once again  
I am trying to see if a cube exists in an array of cubes and although I believe there should be a match, it does not find one. Here is the code snippet, could anyone offer any help please?  
\<code\>  
private function aCuboid():void  
{  
aCubeArray = new Array();  
aCubeArray = BasicCube.\_pointsArray;  
aCube = new Cube();  
aCube.x = \_sent.x  
aCube.y = \_sent.y -17;  
aCube.z = \_sent.z +90;  
//trace(aCube); //$: x:180 y:-20 z:0  
findInArray(aCube,aCubeArray);  
}

```
	private function findInArray(input,Array)
	{
		//trace(input,Array);
		for (var i=0; i&lt;Array.length; i++)
		{
			if(Array* == input)
			{
				trace("Found");
			}
			else
			{
			trace("Not Found");
			}
		}
		
	}

```

\</code\>
