# Error 1502

**URL:** <https://forum.kirupa.com/t/error-1502/313687>\
**Category:** flash\
**Created:** [September 7, 2010, 9:25am UTC](https://forum.kirupa.com/t/error-1502/313687 "2010-09-07T09:25:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![punk123123123](https://avatars.discourse-cdn.com/v4/letter/p/9de0a6/32.png) [@punk123123123](https://forum.kirupa.com/u/punk123123123)\
**Post date:** [September 7, 2010, 9:25am UTC](https://forum.kirupa.com/t/error-1502/313687/1 "2010-09-07T09:25:22Z")

</div>

Error in this code…

Error number 1502

I dunno how to solve this sets of codes.  
Error occurs in the for loop.

For loop code:

```auto

for(var i:int = prevCount; i < count; i++)
			{
				if(i <= 8)	
				{
				apple.x=Math.random();
				addChild(monkey);
				}
			}

```

i got another set of for loop whereby i set it as var r the rest is of a different objects called orange

For loop code:

```auto

for(var i:int = prevCount; i < count; i++)
			{
				if(i <= 8)	
				{
				orange.x=Math.random();
				addChild(monkey);
				}
			}

```

If anyone out there can help me solve the code, kindly leave your email in the reply thread and i will send u my set of codes to solve the error.Thanks alot.
