Ok I’m flummoxed…
Been creating a scroll bar for images. the issue is i cant seem to get sensible stop parameters for the ends of the scroll and scroll bar button. my formulae just wont tie in with the positions at extreme left and right of content/button movement.
The number of images scrolled in the scroller is set by a txt file and is currently at 16, but this is to be changeable. that bit is not an issue, just the scroll parameters. Oh and the Images are in an “images” folder - surprisingly!
text file as follows:
NumberOfImages=16
(file called picsno.txt)
HELP
this is in its now *many *forms driving me bananas!
onClipEvent (enterFrame) {
//_root.scrollgroov.useHandCursor = _root.scrollbar.useHandCursor=true;
_root.scrollbar.useHandCursor =true;
space = 0;
friction = 0.9;
speed = 3;
x = -(_root.scrollbar._x);
//left = 240;
left = _root.scrolling_mc._x;
right = _root.scrolling_mc._x+_root.mask._width-_root.scrolling_mc._width-/*space-*/150;
//right = _root.mask._x+_root.mask._width;
_root.scrollbar.onPress = function() {
drag = true;
_root.scrollbar.startDrag(_root.scrollbar._x,true, 15,883,15,300);// top,right,bot,left?
_root.scrollbar.scrollEase();
};
_root.scrollbar.onMouseUp = function() {
//this.leftDrag();
this.stopDrag();
drag = false;
//cb
//_root.scrollbar._x=mouse._x
};
movescrollbar = function (d) {
if ((_root.scrollbar._x>=x+_root.scrollgroov._width-_root.scrollbar._width && d == 1) || (_root.scrollbar._x<=x && d == -1)) {
clearInterval(myInterval);
} else {
_root.scrollbar._x += d;
_root.scrollbar.scrollEase();
updateAfterEvent();
}
};
MovieClip.prototype.scrollEase = function() {
this.onEnterFrame = function() {
if (Math.abs(dx) == 0 && drag == false) {
delete this.onEnterFrame;
}
r = (_root.scrolling_mc._x-x)/(_root.scrollgroov._width-this._width);
dx = Math.round((((left-(left-right)*r)-_root.scrolling_mc._x)/speed)*friction);
_root.scrolling_mc._x += dx;
};
};
}
OH - flash 8 btw