# Easing rotation to stop at zero MX2004

**URL:** https://forum.kirupa.com/t/easing-rotation-to-stop-at-zero-mx2004/146773
**Category:** Uncategorized
**Created:** [May 4, 2005, 3:35am UTC](https://forum.kirupa.com/t/easing-rotation-to-stop-at-zero-mx2004/146773 "2005-05-04T03:35:05Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![exographicanhon](https://avatars.discourse-cdn.com/v4/letter/e/3d9bf3/32.png) [@exographicanhon](https://forum.kirupa.com/u/exographicanhon)
#### Post date: [May 4, 2005, 3:35am UTC](https://forum.kirupa.com/t/easing-rotation-to-stop-at-zero-mx2004/146773/1 "2005-05-04T03:35:05Z")

</div>

I have an MC which is rotating constantly controlled by an onEnterFrame action. Every frame, the MC rotates by the value of outerspinerate.

onClipEvent(enterFrame) {  
curr\_outer\_rot = this.\_rotation;  
this.\_rotation = curr\_outer\_rot + \_root.dynamo.outerspinrate;  
trace(curr\_outer\_rot);  
}

I noticed in the trace that the rotation values in flash are translated into the range of -180 to +180.

I want the MC rotation to slow to a stop at zero \_rotation value when certain events become true (it’s for a preloader).  
I want this to happen gradually over at least half a rotation, so i’m using something like  
if (allbytesloaded && theMC.\_rotation == -174) {  
decrease the variable ‘outerspinrate’ so that ‘theMC’ slows down gradually to stop at or very near zero \_rotation;

I’m rather scatterbrained at devising logic so can someone help me with this? I’m going to be doing this with 3 clips at once, and one of them will be spinning the opposite way, but explaining it once should enable me to finish the rest. thank you!  
-andy
