# Value is not a function

**URL:** <https://forum.kirupa.com/t/value-is-not-a-function/326921>\
**Category:** flash\
**Created:** [January 22, 2012, 1:06am UTC](https://forum.kirupa.com/t/value-is-not-a-function/326921 "2012-01-22T01:06:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanDaMan](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@DanDaMan](https://forum.kirupa.com/u/DanDaMan)\
**Post date:** [January 22, 2012, 1:06am UTC](https://forum.kirupa.com/t/value-is-not-a-function/326921/1 "2012-01-22T01:06:21Z")

</div>

I’m trying to write a function that iterates through array and runs a trace statement if two specific objects in the array have the same color. In the code below, the variable color is an int used to store the color of the first object, and the function getType() returns an int that corresponds with the color of the object.

```auto

for (var c:int=0; c<10; c++) {
	if (list[5*c]!==null) {
		temp=list[5*c];
		color=temp.getType();
		if (list[5*c+1]!==null) {
			temp=list[5*c+1];
			if (temp.getType()==color) trace("YES");
		}
	}
}

```

This is the error I’m receiving:  
TypeError: Error #1006: value is not a function.

It occurs on the final if statement. I’ve run into this error about 4 or 5 times while working on this project, but this one I cannot seem to get past. Any help would be greatly appreciated. Thanks
