El problema que tengo es que quiero que al 'mantener pulsado' sobre la flecha derecha se desplace seguido hasta acabar de ver el nº de imagenes..y al contrario con la flecha izquierda.
Les posteo el codigo porque está hecho de una forma diferente y no la comprendo, gracias!
stop();
function imageSetHye1() {
this._x += (-(counter-1)*45+imageSet.defaultY-this._x)/4;
}
function imageSetHye2() {
this._x = -scrollSet.scrollBar._x/(scrollGapPoint-scrollBarWidth)*45*(numOfImage-1)+this.defaultY;
}
function scrollBarHye() {
var v3 = scrollGapPoint-scrollBarWidth;
var v2 = scrollStartPoint+(v3/(numOfImage-1));
var v1 = v2*(counter-1);
this.scrollBar._x += (v1-this.scrollBar._x)/4;
}
numOfImage = 8;
imageWidth = 160;
gap = 3000;
counter = 1;
scrollStartPoint = 0;
scrollEndPoint = 955;
scrollGapPoint = scrollEndPoint-scrollStartPoint;
scrollBarWidth = 139;
imageSet.defaultY = imageSet._x;
for (i=1; i<=numOfImage; i++) {
this[i].gotoAndStop(i);
imageSet["s"+i]._x = (i-1)*imageWidth;
imageSet["s"+i]._y = 0;
}
imageSet.onEnterFrame = imageSetHye1;
scrollSet.onEnterFrame = scrollBarHye;
interval = setInterval(fun1, gap);
var v0 = function () {
clearInterval(interval);
this.onEnterFrame = function() {
this.nextFrame();
};
};
scrollSet.rightBtn.onRollOver = v0;
scrollSet.leftBtn.onRollOver = v0;
var v0 = function () {
interval = setInterval(fun1, gap);
this.onEnterFrame = function() {
this.prevFrame();
};
};
scrollSet.rightBtn.onRollOut = v0;
scrollSet.leftBtn.onRollOut = v0;
scrollSet.leftBtn.onPress = function() {
if (counter>1) {
counter--;
}
};
scrollSet.rightBtn.onPress = function() {
if (numOfImage>counter) {
counter++;
};
};
scrollSet.rightBtn.onRelease= function() {
if (numOfImage>counter) {
counter++;
};
}
scrollSet.scrollBar.onPress = function() {
scrollSet.onEnterFrame = null;
imageSet.onEnterFrame = imageSetHye2;
this.startDrag(false,scrollStartPoint,0,scrollEndPoint-scrollBarWidth,0);
};
scrollSet.scrollBar.onRelease = function() {
v3 = scrollGapPoint-scrollBarWidth;
v2 = v3/(numOfImage-1);
v1 = Math.round((this._x-scrollStartPoint)/v2)+1;
counter = v1;
scrollSet.onEnterFrame = scrollBarHye;
imageSet.onEnterFrame = imageSetHye1;
this.stopDrag();
};
scrollSet.scrollBar.onDragOut = function() {
v3 = scrollGapPoint-scrollBarWidth;
v2 = v3/(numOfImage-1);
v1 = Math.round((this._x-scrollStartPoint)/v2)+1;
counter = v1;
scrollSet.onEnterFrame = scrollBarHye;
imageSet.onEnterFrame = imageSetHye1;
this.stopDrag();
};
Sé que es un poco rollo..pero el que lo solucione le daré el archa poder ejecutarlo!
Mil gracias!