# Rotation

**URL:** <https://forum.kirupa.com/t/rotation/197286>\
**Category:** Uncategorized\
**Created:** [August 15, 2006, 7:35am UTC](https://forum.kirupa.com/t/rotation/197286 "2006-08-15T07:35:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![layer](https://avatars.discourse-cdn.com/v4/letter/l/9dc877/32.png) [@layer](https://forum.kirupa.com/u/layer)\
**Post date:** [August 15, 2006, 7:35am UTC](https://forum.kirupa.com/t/rotation/197286/1 "2006-08-15T07:35:56Z")

</div>

i.m trying to create a 3d rotation much like the widely used carousel only the rotation i desire consist of four upright( at 90 degrees) movieclips resting on a slanted, 30 degree plane which rotate (following a tween or way to bring the rotation on stage) on a oval like path - then pause for a given number of seconds(4 to 8 secs) at the same point in the rotation (the lower left corner or the rotation)  
i.m also attempting to bring easing into the rotation with the tween class that will eventually surround a graphic element  
i.m aiming to use four DIFFERENT looking movieclips (maybe with an looping array or ?) instead of the approach i.m using now (attaching mcs).

var count:Number = 0;  
function around() {  
count++;  
if (count\<180) {  
this.\_x = Math.cos(this.angle) \* radiusX + centerX;  
this.\_y = Math.sin(this.angle) \* radiusY + centerY;  
var s = (this.\_y - perspective) /(centerY+radiusY- perspective);  
this.\_y -= (this.\_x-(centerX-radiusX))/Math.sqrt(12);  
this.\_xscale = this.\_yscale = s\*100;  
this.angle += this.\_parent.speed;  
this.swapDepths(Math.round(this.\_xscale) + 100);  
}  
else if(count == 270){  
count = 0;  
}  
}

var numOfBalls:Number = 4;  
var radiusX:Number = 250;  
var radiusY:Number = 75;  
var centerX:Number = Stage.width / 2;  
var centerY:Number = Stage.height / 2;  
var speed:Number = 0.02;  
var perspective:Number = 160;

for(var i=0;i\<numOfBalls;i++) {  
var t = this.attachMovie(“ball”,“b”+i,i+1);  
t.angle = i \* ((Math.PI\*2)/numOfBalls);  
t.onEnterFrame = around;  
}
