
Код:
csH = line._height-bar._height;
nav = _parent.mask._y;
this.onEnterFrame = function() {
//trace(_parent.block._height+"/"+_parent.mask._height)
/////////mask///////////////////////////////
///////////////////////////////////////////
razn = Math.floor((bar._y)/csH*(_parent.block._height-_parent.mask._height));
if (_parent.block._height>_parent.mask._height) {
_parent.block._y = (-this.razn);
bar.barbut.enabled = true;
bar.barbut._alpha = 100;
}
bar.barbut.onPress = function() {
bar.startDrag(0, 0, csH, 0);
};
bar.barbut.onRelease = function() {
bar.stopDrag();
};
bar.barbut.onReleaseOutside = function() {
bar.stopDrag();
};
};
mauseScroll = new Object();
mauseScroll.onMouseWheel = function(delta) {
y = bar._y-delta;
if (y>0 && y<csH) {
bar._y -= delta*5;
} else {
bar._y = -delta*5<0 ? 0 : csH;
}
stoping()
};
Mouse.addListener(mauseScroll);
function stoping() {
if (_parent.block._height<_parent.mask._height) {
bar.barbut.enabled = false;
bar.barbut._alpha = 50;
delete mauseScroll.onMouseWheel
}}
Основан на маске.
где block это мувиклип контента.
mask мувиклип маски.
bar мувик где находиться бегунок,
barbut кнопка бегунок.
line поле по которому ползает бегунок.