# A better method of rotating multiple movieclips?

**URL:** <https://forum.kirupa.com/t/a-better-method-of-rotating-multiple-movieclips/273362>\
**Category:** Uncategorized\
**Created:** [October 14, 2008, 7:47pm UTC](https://forum.kirupa.com/t/a-better-method-of-rotating-multiple-movieclips/273362 "2008-10-14T19:47:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scag](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scag](https://forum.kirupa.com/u/scag)\
**Post date:** [October 14, 2008, 7:47pm UTC](https://forum.kirupa.com/t/a-better-method-of-rotating-multiple-movieclips/273362/1 "2008-10-14T19:47:35Z")

</div>

bHello everyone  
I have my project on my website… [http://www.sillyplaces.com](http://www.sillyplaces.com/)

Granted many problems to sort out, so i am starting in one area. The rotation of multiple movieclips. Click on the smaller circle, drag up/down and the catagories will rotate round.

Its very slow!!!  
The section in my code that does the rotating is in \_root.onEnterFrame. Each movieclip is moved up/down an notch at a time within a ‘for’ loop. this loop is within a larger ‘for’ loop depending how many catagories to move up/down. I shall include this section of code for; i hope, better understanding.

My main question is what is the best way to code this? Although i am not experienced with using a motion tween within my code, is this the right method to use?  
Is this enough information to help me??

Many Thanks  
:o)

\_root.onEnterFrame = function() {  
with (innerCircle) {  
if (dragging or (notches != 0) or (RepeatHowMany \> 0)) {  
// calculate the angle of the joystick  
angle = Math.atan2(\_root.\_ymouse-innerCircle.\_y, \_root.\_xmouse-innerCircle.\_x)/(Math.PI/180);  
\_rotation = angle;

```
        if (notches &lt; -13 or notches &gt; 13) {
            angle = 0;
            notches = 0;
            RepeatHowMany--;
            if (RotateClockwise) {
                for (var i = 9; i&gt;1; i--) {
                    _root["Option"+i].txt = _root["Option"+(i-1)].txt;
                }
                if ((CatagoryPointer-5) &gt;= 0) {
                    _root["Option1"].txt = CatagoryList[CatagoryPointer-5];
                } else {
                    i = CatagoryList.length - (5-CatagoryPointer);
                    _root["Option1"].txt = CatagoryList*;
                }
                CatagoryPointer--;
                if (CatagoryPointer &lt; 0) {
                    CatagoryPointer = CatagoryList.length -1
                }
            } else { // Counter clockwise
                for (var i = 1; i&lt;9; i++) {
                    _root["Option"+i].txt = _root["Option"+(i+1)].txt;
                }
                if ((CatagoryPointer+5) &lt; CatagoryList.length) {
                    _root["Option9"].txt = CatagoryList[CatagoryPointer+5];
                } else {
                    i = (CatagoryPointer+5) - CatagoryList.length;
                    _root["Option9"].txt = CatagoryList*;
                }
                CatagoryPointer++;
                if (CatagoryPointer &gt;= CatagoryList.length) {
                    CatagoryPointer = 0;
                }
            }
        } else {
            if (RepeatHowMany &gt; 0) {
                if (RotateClockwise) {
                    angle = notches++;                    
                } else {
                    angle = notches--;
                }            
            } else {
                if (angle &gt; 0) {
                    RotateClockwise = true;
                    angle = notches++;                    
                } else {
                    angle = notches--;
                    RotateClockwise = false;
                }
            }
        }
        for (var i = 1; i&lt;=9; i++) {
            _root["Background"+i]._rotation = notches+((i*13)-65);
            _root["Option"+i]._rotation = _root["Background"+i]._rotation
        }

        } else {
        if (reloadImages and (RepeatHowMany == 0)) 
        {
            loadSecondStage();
            reloadImages = false;
        } // if (reloadImages) 
    }
}

```

}; //\_root.onEnterFrame = function()
