# Rotation with array

**URL:** <https://forum.kirupa.com/t/rotation-with-array/219373>\
**Category:** flash\
**Created:** [March 15, 2007, 11:56pm UTC](https://forum.kirupa.com/t/rotation-with-array/219373 "2007-03-15T23:56:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lacohido](https://avatars.discourse-cdn.com/v4/letter/l/e8c25b/32.png) [@lacohido](https://forum.kirupa.com/u/lacohido)\
**Post date:** [March 15, 2007, 11:56pm UTC](https://forum.kirupa.com/t/rotation-with-array/219373/1 "2007-03-15T23:56:34Z")

</div>

Hithere-  
Im trying to get these five buttons to rotate to differrent degrees using a narray and for loop. However, when I do this, it just takes the last value (-12) and applys it to each button.  
Check out my code:

```auto

ogRotation = [0,-3,-6,-9,-12];

for(var i=0; i < 5 ;i++){ 
	 test = ogRotation*;
	 _root['swatch'+i].onEnterFrame = function() {
	 	this._rotation += (test-this._rotation)/speed;
	 }
}

```

Also, should I just be doing each button seperatley?  
Thanks!!
