# Smothing mouse

**URL:** https://forum.kirupa.com/t/smothing-mouse/325206
**Category:** flash
**Created:** [October 1, 2011, 12:59pm UTC](https://forum.kirupa.com/t/smothing-mouse/325206 "2011-10-01T12:59:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ben2ng](https://avatars.discourse-cdn.com/v4/letter/b/8491ac/32.png) [@ben2ng](https://forum.kirupa.com/u/ben2ng)
#### Post date: [October 1, 2011, 12:59pm UTC](https://forum.kirupa.com/t/smothing-mouse/325206/1 "2011-10-01T12:59:07Z")

</div>

Greetings,

Hi I am newbies in AS3 pls. help, I create a 3d like box rotate for my website. The problem is when i move my mouse the box is snappy, I want my box to be smooth when i move my mouse in and out. Below is the script.

stage.addEventListener(MouseEvent.MOUSE\_MOVE,rotating);  
function rotating(event:MouseEvent):void{  
album.rotationX=mouseY-200;  
album.rotationY=mouseX-106;

```
if(album.rotationX&gt;190){
    album.rotationX=190;
}
if(album.rotationY&gt;362){
    album.rotationY=363;
}
if(album.rotationX&lt;160){
    album.rotationX=171;
}
if(album.rotationY&lt;354){
    album.rotationY=355;
}
//trace("rotation X " + album.rotationX);
//trace("mouse Y " + (mouseY+10));
//trace("rotation Y " + album.rotationY);
//trace("mouse X " + (mouseX+10));

```

}

Thank you in advance
