# Rotate MC's cw en ccw

**URL:** <https://forum.kirupa.com/t/rotate-mcs-cw-en-ccw/183045>\
**Category:** flash\
**Created:** [March 23, 2006, 10:37am UTC](https://forum.kirupa.com/t/rotate-mcs-cw-en-ccw/183045 "2006-03-23T10:37:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ordell](https://avatars.discourse-cdn.com/v4/letter/o/cc9497/32.png) [@Ordell](https://forum.kirupa.com/u/Ordell)\
**Post date:** [March 23, 2006, 10:37am UTC](https://forum.kirupa.com/t/rotate-mcs-cw-en-ccw/183045/1 "2006-03-23T10:37:54Z")

</div>

Hello,

I have a question about rotating movieclips:

![](http://img99.imageshack.us/img99/3316/switch5ox.jpg)  
If I click on mc1, then mc1 has to go to the position of mc3, mc3 has to go to the position of mc2. The same thing must happen when I click on mc2, it has to move to the position of mc3 and mc3 has to move to the position of mc1. I would like to create some kind of infinitive effect by rotating the mc’s. In a later stadium I want to fill the mc’s with pictures. But I don’t know a proper solution in as. Could somebody help me with this, or does anyone know an example? Thnx in advance.

Ordell

---

<div class="post-metadata">

**Author:** ![Pascal\_S](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@Pascal\_S](https://forum.kirupa.com/u/Pascal_S)\
**Post date:** [March 23, 2006, 11:11am UTC](https://forum.kirupa.com/t/rotate-mcs-cw-en-ccw/183045/2 "2006-03-23T11:11:14Z")

</div>

> **[Moving menu to new coordinates](https://www.kirupa.com/forum/showthread.php?t=199967&highlight=moving+menu)**
>
> Got a web design/development question or just want to hang out with the most awesome people on the planet? Drop on in!

---

<div class="post-metadata">

**Author:** ![Ordell](https://avatars.discourse-cdn.com/v4/letter/o/cc9497/32.png) [@Ordell](https://forum.kirupa.com/u/Ordell)\
**Post date:** [March 23, 2006, 4:43pm UTC](https://forum.kirupa.com/t/rotate-mcs-cw-en-ccw/183045/3 "2006-03-23T16:43:46Z")

</div>

> [@Pascal S.](#):
>
> [http://www.kirupa.com/forum/showthread.php?t=199967&highlight=moving+menu](http://www.kirupa.com/forum/showthread.php?t=199967&highlight=moving+menu)

Thnx for the usefull link but I’m still having problems to build the code.

```auto
var acceleration = 12;
var friction = 0.7;
clipArray = [];
posArray = [];
for (var k = 0; k<6; k++) {
    myclip = attachMovie("mc", "mc"+k, k);
    myclip._y = 50+(myclip._height+40)*k;
    myclip.startx = myclip._x=50;
    myclip.myText.text = "Button "+(k+1);
    clipArray.push(myclip);
    countArray.push(k);
    posArray.unshift(myclip._y);
    myclip.onPress = dostuff;
}
function move() {
    var xdif = posArray[this.jvar]-this._y;
    this.xspeed += xdif/this._parent.acceleration;
    this.xspeed *= this._parent.friction;
    this._y += this.xspeed;
    checkDistance.apply(this);
}
checkDistance = function () {
    if (Math.abs(posArray[this.jvar]-this._y)<1) {
        this._y = posArray[this.jvar];
        if(this._x !=this.startx){
            for(var obj in cliparray){
                cliparray[obj].enabled =true
                cliparray[obj].gotoAndStop(1)
            }
            this.enabled = false
            this.gotoAndStop(2)
        this.onEnterFrame = tweenx;
        }
    }
};
function tweenx() {
    this._x += (this.startx-this._x)/4;
    if (Math.abs(this.startx-this._x)<2) {
        this._x = this.startx;
        delete this.onEnterFrame;
        
    }
}
function dostuff() {
    this._x -= this._width;
    for (var i = 0; i<clipArray.length; i++) {
        clipArray*.ivar = i;
    }
    k = clipArray.splice(this.ivar, 1);
    clipArray = clipArray.concat(k);
    for (var j = 0; j<posArray.length; j++) {
        clipArray[j].jvar = j;
        trace(clipArray[j]+" "+clipArray[j].jvar);
        clipArray[j].onEnterFrame = move;
    }
}

```

I want to have one mc out of the row and set it right of the row with mc’s. How can I manage this? Thnx in advance

Ordell
