# onMouseWheel + Math.round + Boundaries?

**URL:** <https://forum.kirupa.com/t/onmousewheel-math-round-boundaries/170515>\
**Category:** Uncategorized\
**Created:** [November 27, 2005, 12:04am UTC](https://forum.kirupa.com/t/onmousewheel-math-round-boundaries/170515 "2005-11-27T00:04:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blaatorx](https://avatars.discourse-cdn.com/v4/letter/b/f17d59/32.png) [@blaatorx](https://forum.kirupa.com/u/blaatorx)\
**Post date:** [November 27, 2005, 12:04am UTC](https://forum.kirupa.com/t/onmousewheel-math-round-boundaries/170515/1 "2005-11-27T00:04:29Z")

</div>

Peepz,

I have a movieclip that has a height of 500 px, it starts on \_y = 0, now i want to scroll it on integers with Math.round but it won’t work. I also want it to stop scrolling down if he is at the bottom or the top (it behind a mask)

the tween method works fine so let it as it is…

hope somebody can help?

thanks already!

```auto

mover = 0
var mouseListener = new Object();
mouseListener.onMouseWheel = function(delta) {
	   
 mover += Math.round(10*delta);
 mcTempHolder.tween("_y", mover, 1); 
 
};
Mouse.addListener(mouseListener);

```
