# So annoying! if statement problem

**URL:** <https://forum.kirupa.com/t/so-annoying-if-statement-problem/170662>\
**Category:** Uncategorized\
**Created:** [November 28, 2005, 5:40pm UTC](https://forum.kirupa.com/t/so-annoying-if-statement-problem/170662 "2005-11-28T17:40:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![knappster](https://avatars.discourse-cdn.com/v4/letter/k/67e7ee/32.png) [@knappster](https://forum.kirupa.com/u/knappster)\
**Post date:** [November 28, 2005, 5:40pm UTC](https://forum.kirupa.com/t/so-annoying-if-statement-problem/170662/1 "2005-11-28T17:40:58Z")

</div>

In my first frame, I load in some XML and set a variable:

```auto
for (var i = 0; i<countriesLength; i++) {
			_global["numberID"+*] = countriesName*.firstChild.nextSibling.childNodes;
		}

```

That works.

Now in frame two, I trace it, to make sure it’s there:

```auto
for (var i = 0; i<countryIDLength; i++) {
	trace(_global["numberID"+*]);

```

And it returns the numbers:

2  
7  
9  
5  
29  
346

…that’s perfect.

Now I want to set if statements inside the “for”:

```auto
	if ((_global["numberID"+*]) == 2){
		trace(_root["instanceID"+*] + " is 2");
	}

```

and it returns nothing, not even an error. Is it possible that the var should be specified as a :Number ?? How do I make this if statement work!?

Thanks,

aok
