# Rotate 360deg with easing on rollover

**URL:** https://forum.kirupa.com/t/rotate-360deg-with-easing-on-rollover/51356
**Category:** Uncategorized
**Created:** [May 12, 2004, 8:46am UTC](https://forum.kirupa.com/t/rotate-360deg-with-easing-on-rollover/51356 "2004-05-12T08:46:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![therockstar](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@therockstar](https://forum.kirupa.com/u/therockstar)
#### Post date: [May 12, 2004, 8:46am UTC](https://forum.kirupa.com/t/rotate-360deg-with-easing-on-rollover/51356/1 "2004-05-12T08:46:51Z")

</div>

I’m trying to rotate a movie clip button once upon rollover with easing. calling the code below on rollover… as you’d expect this causes the button to spin infinitely as 360 also equals 0. how can I make this work so the clip only spins once with easing…

```auto
MovieClip.prototype.spin = function() {
var targetR = 360;
this.onEnterFrame = function() {
this._rotation=targetR-(targetR-this._rotation)/1.5;
if (this._rotation > targetR-0.1 && this._rotation<targetR + 0.1) {
delete this.onEnterFrame;
} 
}
}

```

All help greatfully received!!!

Cheers

Nick
