# Using the properties of an element in an array..Can I?

**URL:** <https://forum.kirupa.com/t/using-the-properties-of-an-element-in-an-array-can-i/323344>\
**Category:** flash\
**Created:** [June 26, 2011, 7:38pm UTC](https://forum.kirupa.com/t/using-the-properties-of-an-element-in-an-array-can-i/323344 "2011-06-26T19:38:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rimacy](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@rimacy](https://forum.kirupa.com/u/rimacy)\
**Post date:** [June 26, 2011, 7:38pm UTC](https://forum.kirupa.com/t/using-the-properties-of-an-element-in-an-array-can-i/323344/1 "2011-06-26T19:38:34Z")

</div>

i have an array containing all the bases in a game… when my ship lands a proximity check is made between the ship and each member of the basesArray…  
i want to iterate through the array and subtract the ship x/y from the array element(base)x/y. if the result is between 50 +/- that element becomes the active base. here’s the code:

```auto
public function baseProximityCheck():void 
	{
		for (var i:Object; i<playScreen.baseArray.length; i++)
		{
	               trace("view395 baseX-shipX = "+i.x-playScreen.ship.x)
						
	         }
			
	}

```

and i’m getting the following:

```auto
1067: Implicit coercion of a value of type String to an unrelated type Number.
1118: Implicit coercion of a value with static type Object to a possibly unrelated type Number.

```

how can i access the properties of an array element?
