holaaaaaaaaa!!
es buenísimo la solución... lo estaba buscando y sato encuentro fue... ahora, quiero saber algo, yo lo quiero usar para scrollear, con dos flechitas (btnUp y btnDown), un mc (instanciado "contenido"). logré que bajara lindo, pero no pude hacerlo para que funciona hacia ambos lados... no entiendo la lógica de por qué está funcionando mal.
Código :
var i:Boolean = false;
var c:Number = 0;
function Falso()
{
i = false;
}
function revisar()
{
if(i)
{
if(_root.sitio.contenido._y < 362)
{
_root.sitio.btnUp.enabled = true;
_root.sitio.btnDown._alpha = 100;
_root.sitio.contenido._y=_root.sitio.contenido._y+20;
}
else
{
//_root.sitio.btnUp.enabled = false;
_root.sitio.btnUp._alpha = 20;
}
//-----------------------------------------------
if (_root.sitio.contenido._y > -278)
{
_root.sitio.btnDown.enabled = true;
_root.sitio.btnUp._alpha = 100;
_root.sitio.contenido._y=_root.sitio.contenido._y-20;
}
else
{
//_root.sitio.btnDown.enabled = false;
_root.sitio.btnDown._alpha = 20;
}
}
}
btnUp.onPress = function()
{
i = true;
}
btnDown.onPress = function()
{
i = true;
}
setInterval(revisar, 50);///estas son las ocasiones cuando detenemos nuestra rutina
btnUp.onRelease = Falso;//cuando soltamos el click
btnUp.onRollOut = Falso;//cuando desplazamos fuera del botón
btnUp.onDragOut = Falso;//cuando desplazamos fuera del botón con el click sostenido
btnDown.onRelease = Falso;//cuando soltamos el click
btnDown.onRollOut = Falso;//cuando desplazamos fuera del botón
btnDown.onDragOut = Falso;//cuando desplazamos fuera del botón con el click sostenido
if(_root.sitio.contenido._y >= 362)
{
_root.sitio.btnUp._alpha = 20;
}
sí, seguro van a ver una brutalidad... pero es el arte de no saber y experimentar... ayuda por favor... gracias... saludos!
emiliano