Mouse scroll contents

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