ti crei un clip "container" che contiene appunto le foto, lo posizioni in _x = 0
ti crei una barra (clip) lunga quanto lo stage 550 alta 12 e la istanzi "fondo"
ti crei una baretta (clip) lunga 55 alta 12 e la istanzi "fader"
sovrapponi esattamente "fader" a "fondo" selezioni tutti e 2 e F8 converti in clip istanziato "scroller"
posizioni scroller in _x = 0
poi attacchi il seguente codice
codice:
barra = this.scroller;
barretta = this.scroller.fader;
clip = this.container;
limite = barra._width-barretta._width;
function scrolling() {
if (scroll) {
barretta.onEnterFrame = function() {
posX = Math.round(-(barretta._x*(clip._width-limite)/limite));
spostamento = Math.round((posX-clip._x)/3);
clip._x += (spostamento+3);
};
} else {
delete barretta.onEnterFrame;
}
}
barretta.onPress = function() {
this.startDrag(false, 0, 0, limite, 0);
scroll = true;
scrolling();
};
barretta.onRelease=barretta.onReleaseOutside = function() {
this.stopDrag();
scroll = false;
};
ed ottieni
http://www.rempox.it/forum/scroller_oriz/scroller.html
Ciao