# Rotating slow down

**URL:** https://forum.kirupa.com/t/rotating-slow-down/299735
**Category:** flash
**Created:** [November 10, 2009, 11:57am UTC](https://forum.kirupa.com/t/rotating-slow-down/299735 "2009-11-10T11:57:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![iliy](https://avatars.discourse-cdn.com/v4/letter/i/e95f7d/32.png) [@iliy](https://forum.kirupa.com/u/iliy)
#### Post date: [November 10, 2009, 11:57am UTC](https://forum.kirupa.com/t/rotating-slow-down/299735/1 "2009-11-10T11:57:23Z")

</div>

Sorry for my english!

Help please!  
I try writing code for my movie, i need this movie rotate and when i release him - this slow rotation down. This must look as whirligig.  
Any ideas?

Big Thanks!!!

```auto

this.onPress = function () {
    pressing = true;
    speed=100;
    old_x=_root._xmouse;
};
this.onRelease = onReleaseOutside = function () {
    pressing = false;
    new_x=_root._xmouse;
    speed=new_x+old_x/2;
};
this.onEnterFrame = function () {
    if (pressing == true) {
        myRadians = Math.atan2 ((_root._ymouse - this._y), (_root._xmouse - this._x));
        myDegree = Math.round (myRadians * 180 / Math.PI);
        this._rotation = myDegree;
    }else if(pressing == false){
        speed--;
        this._rotation-=speed;//[COLOR=DarkRed](??? what i make wrong?)[/COLOR]
    }
};

```
