# Mouse scroll contents

**URL:** <https://forum.kirupa.com/t/mouse-scroll-contents/199584>\
**Category:** Uncategorized\
**Created:** [September 4, 2006, 8:09am UTC](https://forum.kirupa.com/t/mouse-scroll-contents/199584 "2006-09-04T08:09:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jim1](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@jim1](https://forum.kirupa.com/u/jim1)\
**Post date:** [September 4, 2006, 8:09am UTC](https://forum.kirupa.com/t/mouse-scroll-contents/199584/1 "2006-09-04T08:09:02Z")

</div>

hi  
i tried to make auto scroll for contents  
it works but someting is wrong

[AS]  
function core() {  
buttons\_height = 566.3; //this is the height of the contents (buttons)  
mask\_height = 319; //this is the height of the mask (mask)  
the\_speed = 6;  
if (mask.hitTest(\_root.\_xmouse, \_root.\_ymouse, false)) {  
mousepos = \_ymouse;  
}  
persent = (mousepos/mask\_height)/2\*-1;  
pos = persent\*(buttons\_height+10);  
newpos = oldy+(pos+3-oldy)/the\_speed;  
setProperty(this.buttons, \_y, newpos);  
oldy = getProperty(this.buttons, \_y);  
}  
core();  
[/AS]

see the attachment please  
thanks
