# Using a for lopp with an array issue (newb warning!)

**URL:** <https://forum.kirupa.com/t/using-a-for-lopp-with-an-array-issue-newb-warning/200392>\
**Category:** Uncategorized\
**Created:** [September 11, 2006, 9:29pm UTC](https://forum.kirupa.com/t/using-a-for-lopp-with-an-array-issue-newb-warning/200392 "2006-09-11T21:29:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sodyPop](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@sodyPop](https://forum.kirupa.com/u/sodyPop)\
**Post date:** [September 11, 2006, 9:29pm UTC](https://forum.kirupa.com/t/using-a-for-lopp-with-an-array-issue-newb-warning/200392/1 "2006-09-11T21:29:48Z")

</div>

hey forumfolk.  
i am learning all about the for loop and using arrays (i am a designer, not a programmer so it’s hard for me). anyways, i am confused about something and i am hoping someone can help.  
i have 6 transparent buttons on the root and 6 movieclips i am trying to control with them. the buttons are named the same as in the navs array.  
the clips i am trying to control are named the same but with MC at the end.  
my thought is that i could use the navs array for loop to control the clips if i could figure out a way to append the “MC” to the instance name when i needed to.

```auto

var navs = [news, about, services, clients, projects, contact];
for (var i = 0; i<navs.length; i++) {
	_root.navs*.onRollOver = function() {
		_root[this+"MC"].back.colorTo(0xff9900, .3, 'easeOutQuad');
	};
	navs*.onRollOut = navs*.onReleaseOutside=function () {
		_root[this+"MC"].back.colorTo(null, .3, 'easeOutQuad');
	};
	navs*.onRelease = function() {
		activateItem(this);
		_root[this+"MC"].gotoAndPlay(2);
	};
	activateItem = function (item) {
		if (this.currentItem != false) {
			this.deActivateItem();
		}
		this.currentItem = item;
		this.currentItem.enabled = false;
		_root[this+"MC"].back.colorTo(0xffcc00, .3, 'easeOutQuad');
	};
}
this.deActivateItem = function() {
	_root[this+"MC"].gotoAndPlay(13);
	this.currentItem.enabled = true;
	this.currentItem = undefined;
};
stop();

```

it seems like it should work, i am doing something dumb i know it,  
maybe you can help?

thanks kindly,  
sodypop
