# Iffy if statements

**URL:** <https://forum.kirupa.com/t/iffy-if-statements/288790>\
**Category:** Uncategorized\
**Created:** [May 21, 2009, 1:17am UTC](https://forum.kirupa.com/t/iffy-if-statements/288790 "2009-05-21T01:17:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brent\_Summers](https://avatars.discourse-cdn.com/v4/letter/b/b19c9b/32.png) [@Brent\_Summers](https://forum.kirupa.com/u/Brent_Summers)\
**Post date:** [May 21, 2009, 1:17am UTC](https://forum.kirupa.com/t/iffy-if-statements/288790/1 "2009-05-21T01:17:39Z")

</div>

I am having an interesting time trying to get some looping if statements to work.

The main culprit I THINK are those parentheses.

With **out** them it doesn’t work at all.

With them only the trace statement will work, but only if I comment out the other stuff. Other wise all I get is this wierd “value is not a function” error.

Could someone please drop some knowledge on me for how this syntax works?

!!!Thanks!!!

Code:  
function TestLoop(e:Event):void  
_{_

- for (var n:Number = 0; n\<xmlList.length\*[SIZE=5]**()**[/SIZE]_; n++)  
{  
if (xmlList[n].attribute(“locked”) == “yes”)  
{  
\*\* trace (“locked”);\*\*  
xmlList[n].removeEventListener(MouseEvent.CLICK, onSelected);  
xmlList[n].removeEventListener(MouseEvent.MOUSE\_OVER, onOver);  
xmlList[n].gotoAndStop(2);  
}  
else  
{  
trace (“not locked”);  
}  
}_
- }\*
