# Damn onMouseWheel

**URL:** <https://forum.kirupa.com/t/damn-onmousewheel/175472>\
**Category:** Uncategorized\
**Created:** [January 14, 2006, 8:06pm UTC](https://forum.kirupa.com/t/damn-onmousewheel/175472 "2006-01-14T20:06:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eurosickwitit](https://avatars.discourse-cdn.com/v4/letter/e/6f9a4e/32.png) [@eurosickwitit](https://forum.kirupa.com/u/eurosickwitit)\
**Post date:** [January 14, 2006, 8:06pm UTC](https://forum.kirupa.com/t/damn-onmousewheel/175472/1 "2006-01-14T20:06:52Z")

</div>

Ok so here is the deal. I’m having trouble with something that has to do with mousewheel in flash. Basically all i want to do is to rotoate a movieclip (lets say a square) onMouseWheel 90 degrees at a time. But i dont want the movieclip to just jump 90 degrees in rotation but i want it to ease 90 degrees and stop. If user does it again rotate another 90 with ease and stop. If user scrolls the mousewheel in the opposite direction i want the movieclip to rotate 90 degrees the other way with ease. Frost helped me whip somethin up however I did not want to bother him anymore. Here is where I’m at right now. Please someone helpe me if you can.

TO SEE WHAT I CURRENTLY HAVE CREATE ANY MOVIECLIP, AND GIVE IT AN INSTANCE NAME t

and then copy this actionscript onto a frame  
[COLOR=Blue]  
var ml = new Object();  
ml.onMouseWheel = function(delta) {  
t.ease(delta\*45);  
};  
Mouse.addListener(ml);  
MovieClip.prototype.ease = function(v) {  
this.onEnterFrame = function() {  
this.\_rotation -= (v+this.\_rotation)/3;  
if (Math.round(this.\_rotation) == Math.round(v)) {  
delete this.onEnterFrame;  
}  
};  
};

[COLOR=Black]I dont kno where to go from here, help me.[/COLOR]

[/COLOR]
