A ver si alguien ve mejor que le pasa a esto y se le ocurre algo para que funcione.
Gracias por la ayuda por anticipado.
Código :
import mx.transitions.Tween;
function mover(peli, propiedad, posInicial, posFinal, tiempo) {
var myTween:Tween = new Tween(peli, propiedad, mx.transitions.easing.Elastic.easeOut, posInicial, posFinal, tiempo, true);
}
boton_der.onRelease = function() {
posInicial = tirabotones._x;
posFinal = posInicial-45;
mover(tirabotones, "_x", posInicial, posFinal, 0.2);
esconder();
};
boton_izq.onRelease = function() {
posInicial = tirabotones._x;
posFinal = posInicial+45;
mover(tirabotones, "_x", posInicial, posFinal, 0.2);
esconder();
};
function esconder() {
if (eval.tirabotones._x >= 290 or eval.tirabotones._x <= -420){
boton_der._visible = 1;
boton_izq._visible = 0;
}else if (eval.tirabotones._x <= -430){
boton_der._visible = 0;
boton_izq._visible = 1;
} else {
boton_der._visible = 1;
boton_izq._visible = 1;
}
eval.tirabotones._x;
trace(tirabotones._x);
}
esconder();
