:
:d
Salve a tutti,
è un pò di giorni che lavoro a questo scrolling ma non ci salto fuori:
immagine che scorre al comando del mouse con stop della stessa a fine corsa sia a dx che a sx. E fin qui va bene.
Vorrei, però, applicare l'effetto "rallentamento" prima dello stop per avere un risultato più fluido.
Ringrazio anticipatamente per l'aiuto.
Saluti.
Uso MX
Allego il codice fatto :
varimg = _root.img;
varbgd = _root.bgd;
v = 0.15;
mousex = varbgd._xmouse;
mousey = varbgd._ymouse;
imgx = getProperty(varimg, _x);
left = getProperty(varimg, _width)/2;
right = (getProperty(varimg, _width)/(-2))+(getProperty(varbgd, _width));
setProperty(varimg, _x, (imgx+(mousex*v)));
// left
if (getProperty(varimg, _x)>=left) {
if (mousex>0) {
mousex = 0;
setProperty(varimg, _x, left);
} else if (mousex<0) {
mousex = varbgd._xmouse;
setProperty(varimg, _x, (imgx+(mousex*v)));
}}
// right
if (getProperty(varimg, _x)<=right) {
if (mousex<0) {
mousex = 0;
setProperty(varimg, _x, right);
} else if (mousex>0) {
mousex = varbgd._xmouse;
setProperty(varimg, _x, (imgx+(mousex*v)));
}}
set("_level0:x", imgx);
set("_level0:mx", mousex);

Rispondi quotando
