# Disk game

**URL:** https://forum.kirupa.com/t/disk-game/228279
**Category:** Uncategorized
**Created:** [June 6, 2007, 5:31pm UTC](https://forum.kirupa.com/t/disk-game/228279 "2007-06-06T17:31:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Hansol](https://avatars.discourse-cdn.com/v4/letter/h/958977/32.png) [@Hansol](https://forum.kirupa.com/u/Hansol)
#### Post date: [June 6, 2007, 5:31pm UTC](https://forum.kirupa.com/t/disk-game/228279/1 "2007-06-06T17:31:59Z")

</div>

Im working on a script where you would have a disk and it would keep spinning, but when you clicked on it it would stop, and then you could rotate it like a turntable. I tried using some trigonometry but that made the disk turn to the mouse when ever i clicked on it, which doesnt normally happen when you try and spin it. Heres what i have, but i havent thought of a way to drag it without it sticking to the mouse x/y.

```auto

spinning = false;
disk.onEnterFrame = function() {
 if (!spinning) {
  disk._rotation += 2;
 }
 this.onPress = function() {
  spinning = true;
 };
 this.onReleaseOutside = this.onRelease=function () {
  spinning = false;
 };
};

```
