// SET Y INITIAL POSITION
targY = 0;
// SET THE INITIAL POSIZION OF THE SCROLLER X
//dragger._x = mask._width;
// DRAG FUNCTION
scroller.onPress = function() {
startDrag(this, false, this._x, 0, this._x, mask._height-this._height);
};
// END DRAG
scroller.onRelease = scroller.onReleaseOutside=function () {
stopDrag();
};
// MANAGE THE MOVEMENTS THAT CONTENT SHOULD DO
content.onEnterFrame = function() {
// CALCULATE THE MOVEMENT THE CONTENT WILL DO
movement = (this._height-(mask._height/1.3))/(mask._height-scroller._height);
// RE REST THE Y POSITION
targY = -scroller._y*movement;
// INCREASE OR DECREASE THE NUMBER "7" TO MOVE THE CONTENT FASTER OR SLOWER
this._y -= (this._y-targY)/7;
};
stop();
Read and Implement!
ReplyDelete