# Loops, Arrays and getting stuck!

**URL:** https://forum.kirupa.com/t/loops-arrays-and-getting-stuck/196169
**Category:** flash
**Created:** [August 6, 2006, 9:24am UTC](https://forum.kirupa.com/t/loops-arrays-and-getting-stuck/196169 "2006-08-06T09:24:02Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![theSchtickler](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@theSchtickler](https://forum.kirupa.com/u/theSchtickler)
#### Post date: [August 6, 2006, 9:24am UTC](https://forum.kirupa.com/t/loops-arrays-and-getting-stuck/196169/1 "2006-08-06T09:24:02Z")

</div>

Hi there,

I’ve been trying to write cleaner code, but every time i try, I get stuck! This is a perfect example, I know that its kind of wrong, but I have no idea how to fix it ☹

I need the ‘newPos’ to have a different value on each button, but it just doesn’t seem to work.

menuYpositions = new Array(0, -34.5, -69, -103.5, -138);

for (i=1; i\<5; i++){  
clipName = eval(‘mcRollOver’ + i);   
clipName.onRollOver = function(){  
newPos = menuYpositions\*;  
yTapeScale = new Tween(mcMenuText.mcAllText, “\_y”, Strong.easeInOut, mcMenuText.mcAllText.\_y, newPos, 15, false);  
}  
}

Any one have any ideas?
