# Function question

**URL:** https://forum.kirupa.com/t/function-question/67077
**Category:** Uncategorized
**Created:** [October 12, 2004, 1:41pm UTC](https://forum.kirupa.com/t/function-question/67077 "2004-10-12T13:41:40Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Rockstar](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@Rockstar](https://forum.kirupa.com/u/Rockstar)
#### Post date: [October 12, 2004, 1:41pm UTC](https://forum.kirupa.com/t/function-question/67077/1 "2004-10-12T13:41:40Z")

</div>

Hi

I just learnt how to write a function, and it is so difficult [I do enjoy however though]  
Anyway,  
I’m planning to make a button that when clicked, it will rotate 4 same movie clips.  
This is my code:

var rotateDirection;  
function rotateStart (rotateSpeed, gearSet) {

for (i=1; i\<3; i++) {  
this[gearSet+i].\_rotation+= (rotateSpeed\*rotateDirection);  
}  
}  
this.onEnterFrame=function () {

a\_btn.onRelease=function () {  
var rotateDirection = 1;  
rotateStart (10, “a\_gears”);  
rotateStart (10, “b\_gears”);

}

}

please let me know where it goes wrong?  
thank alot [you never know how much I appreciate this]
