Código ActionScript :
mouseListener = new Object();
mouseListener.onMouseWheel = function(delta) {
texto._y += delta;
barra._y -= delta;
}
Mouse.addListener(mouseListener);Utilizo ese código. Pero quiero ponerle un límite de alto y bajo a "texto" y a "barra", pero a la vez los dos tienen límites distintos.
Muchas gracias por la ayuda!
P.D: Este es el código que utilizo para el scroll común con la barra de desplazamiento.
Código ActionScript :
function mover()
{
muevo2 = (pos_fin_barra - barra._y) * 100 / recorrido_barra;
muevo = 100 - muevo2;
move = muevo * recorrido_texto / 100;
texto.onEnterFrame = null;
r = mascara._y - move;
texto.onEnterFrame = function ()
{
r2 = (r - this._y) / 8;
if (r2 >= 5.000000E-001 || r2 < -5.000000E-001)
{
this._y = this._y + r2;
}
else
{
this.onEnterFrame = null;
} // end else if
};
} // End of the function
stop ();
var pos_ini_barra = mask._y;
var pos_fin_barra = mask._y + mask._height - barra._height;
var pos_x_barra = barra._x = 578;
var recorrido_barra = pos_fin_barra - pos_ini_barra;
var pos_ini_texto = mascara._y;
var pos_fin_texto = mascara._y - (texto._height - mascara._height);
var recorrido_texto = 0;
if (pos_fin_texto < 0)
{
t = pos_fin_texto * -1;
recorrido_texto = mascara._y + t;
}
else
{
recorrido_texto = pos_inicio_texto - pos_fin_texto;
} // end else if
barra.onPress = function ()
{
this.startDrag(false, pos_x_barra, pos_ini_barra, pos_x_barra, pos_fin_barra);
id = setInterval(mover, 100);
};
barra.onRelease = barra.onReleaseOutside = function ()
{
this.stopDrag();
clearInterval(id);
}; 