# Code breakdown in for loop. Array Syntax

**URL:** <https://forum.kirupa.com/t/code-breakdown-in-for-loop-array-syntax/198859>\
**Category:** Uncategorized\
**Created:** [August 29, 2006, 6:26am UTC](https://forum.kirupa.com/t/code-breakdown-in-for-loop-array-syntax/198859 "2006-08-29T06:26:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jopper](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@jopper](https://forum.kirupa.com/u/jopper)\
**Post date:** [August 29, 2006, 6:26am UTC](https://forum.kirupa.com/t/code-breakdown-in-for-loop-array-syntax/198859/1 "2006-08-29T06:26:30Z")

</div>

I’ve got this loop and can’t get it to work. It won’t read the trace so I know the array call in my function statement is wrong but I can’t see it at the moment. What am I doing wrong here? The rollover works when I write it out repetitively for the four buttons. Thanks for the help.

[SIZE=“1”]var btnAction:Array = new Array (oneBut, twoBut, threeBut, fourBut);  
for (var i=0; i\<btnAction.length; i++) {  
this.menuMC.btnAction\*.onRollOver = this.menuMC.btnAction\*.onDragOver = function() {  
trace(“anything”);  
}  
};[/SIZE]
