Frame 1
scrolling = function () {
var _local1 = this;
var __reg5 = scrollTrack._height;
var __reg2 = contentMain._height;
var _local3 = scrollFace._height;
var _local2 = maskedView._height;
var initPosition = ((scrollFace._y = scrollTrack._y));
var initContentPos = contentMain._y;
var finalContentPos = ((_local2 - __reg2) + initContentPos);
var left = scrollTrack._x;
var top = scrollTrack._y;
var right = scrollTrack._x;
var bottom = ((scrollTrack._height - _local3) + scrollTrack._y);
var dy = 0;
var speed = 10;
var moveVal = ((__reg2 - _local2) / (__reg5 - _local3));
scrollFace.onPress = function () {
var _local1 = this;
var __reg2 = _local1._y;
startDrag (_local1, false, left, top, right, bottom);
_local1.onMouseMove = function () {
dy = Math.abs(initPosition - this._y);
contentMain._y = Math.round(((dy * -1) * moveVal) + initContentPos);
};
};
scrollFace.onMouseUp = function () {
stopDrag();
delete this.onMouseMove;
};
btnUp.onPress = function () {
this.onEnterFrame = function () {
if ((contentMain._y + speed) < maskedView._y) {
if (scrollFace._y <= top) {
scrollFace._y = top;
contentMain._y = contentMain._y + speed;
} else {
contentMain._y = contentMain._y + speed;
scrollFace._y = scrollFace._y - (speed / moveVal);
}
return(undefined);
}
scrollFace._y = top;
contentMain._y = maskedView._y;
delete this.onEnterFrame;
};
};
btnUp.onDragOut = function () {
delete this.onEnterFrame;
};
btnUp.onRelease = function () {
delete this.onEnterFrame;
};
btnDown.onPress = function () {
this.onEnterFrame = function () {
if ((contentMain._y - speed) > finalContentPos) {
if (scrollFace._y >= bottom) {
contentMain._y = contentMain._y - speed;
scrollFace._y = bottom;
} else {
contentMain._y = contentMain._y - speed;
scrollFace._y = scrollFace._y + (speed / moveVal);
}
return(undefined);
}
scrollFace._y = bottom;
contentMain._y = finalContentPos;
delete this.onEnterFrame;
};
};
btnDown.onRelease = function () {
delete this.onEnterFrame;
};
btnDown.onDragOut = function () {
delete this.onEnterFrame;
};
if (__reg2 < _local2) {
scrollFace._visible = false;
btnUp.enabled = false;
btnDown.enabled = false;
} else {
scrollFace._visible = true;
btnUp.enabled = true;
btnDown.enabled = true;
}
};
scrolling();