gotoAndStop from draggable slider?

Hi - hope you can help

Basically, I’m trying to get a movie clip (called “scroll” and located on the _root timeline) to jump to and stop on frames 1-40 depending on where a draggable slider is positioned. The slider goes from 0 - 140 on the y axis.

The code in the slider itself is as follows:

on (press) {
startDrag("", false, 0, 0, 0, 140);
dragging = true;
}

on (release, releaseOutside) {
stopDrag();
dragging = false;
}

and then

onClipEvent (load) {
top = _y;
bottom = top + 140;
left = _x;
right = _x;
}
onClipEvent (load) {
if (dragging == true) {
gotoAndStop("_root.scroll", (_y-100));
}
}

on the level above. I’m realising this isn’t right as the slider makes no difference to the targeted MC.

Any advice??

Thanks

j