# Spinning an object with the mouse (sort of a drag)?

**URL:** <https://forum.kirupa.com/t/spinning-an-object-with-the-mouse-sort-of-a-drag/200923>\
**Category:** flash\
**Created:** [September 16, 2006, 5:36pm UTC](https://forum.kirupa.com/t/spinning-an-object-with-the-mouse-sort-of-a-drag/200923 "2006-09-16T17:36:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![REEF](https://avatars.discourse-cdn.com/v4/letter/r/ce73a5/32.png) [@REEF](https://forum.kirupa.com/u/REEF)\
**Post date:** [September 16, 2006, 5:36pm UTC](https://forum.kirupa.com/t/spinning-an-object-with-the-mouse-sort-of-a-drag/200923/1 "2006-09-16T17:36:20Z")

</div>

I’ve figured out spinning a wheel-like object using the mousewheel:

```auto
var spinRate:Number = 10;
var mouseWheelListener:Object = new Object();
mouseWheelListener.onMouseWheel = function(delta:Number) {
	delta < 0 ? wheelObject._rotation += spinRate : wheelObject._rotation -= spinRate;
};
Mouse.addListener(mouseWheelListener);

```

(For anyone who wants to know) - & now I’m looking for a way to be able to click the wheel & turn it as the mouse is clicked at the users will?

Heres an example: [http://www.flashloaded.com/flashcomponents/flashcontrollers/images/demo\_wheel.html](http://www.flashloaded.com/flashcomponents/flashcontrollers/images/demo_wheel.html)

But as you can see, the knob only spins according to the \_ymouse, if you try to rotate it while holding the edges it doesnt really work. Click on the last marker at the right end of the knob & then move your cursor around the circumference of the knob, it doesnt really turn well. Any ideas?
