Tema: Menu, HELP !
Ver Mensaje Individual
  #4 (permalink)  
Antiguo 24/01/2010, 11:55
EzequielM
 
Fecha de Ingreso: enero-2010
Mensajes: 25
Antigüedad: 14 años, 4 meses
Puntos: 1
Respuesta: Menu, HELP !

Esta buena la idea, pero haciendo a mano con interpolaciones la animación de cada botón te vas a volver loco (y solo hay 5 botones). La opción es la Clase tween, que te permite hacer esas animaciones con una línea de código. Para eso tendrían que ser 5 clips en vez de botones (btn1,btn2,btn3,btn4,btn5) y con este código en el primer fotograma queda así http://ezequielm.comuv.com/animacion_tween.html. Se puede refinar más, pero espero te sirva para empezar

import mx.transitions.Tween;
import mx.transitions.easing.*;

pos1=btn1._x
pos2=btn2._x
pos3=btn3._x
pos4=btn4._x
pos5=btn5._x
actual=143

btn1.onRollOver=function()
{
this.swapDepths(_root.getNextHighestDepth());
actual=btn1._x;
entrar();
}
btn1.onRollOut=function()
{
salir();
}

btn2.onRollOver=function()
{
this.swapDepths(_root.getNextHighestDepth());
actual=btn2._x;
entrar();
}
btn2.onRollOut=function()
{
salir();
}

btn3.onRollOver=function()
{
this.swapDepths(_root.getNextHighestDepth());
actual=btn3._x;
entrar();
}
btn3.onRollOut=function()
{
salir();
}
btn4.onRollOver=function()
{
this.swapDepths(_root.getNextHighestDepth());
actual=btn4._x;
entrar();
}
btn4.onRollOut=function()
{
salir();
}

btn5.onRollOver=function()
{
this.swapDepths(_root.getNextHighestDepth());
actual=btn5._x;
entrar();
}
btn5.onRollOut=function()
{
salir();
}

function entrar()
{
var tween_handler:Object = new Tween(btn1, "_x", Strong.easeOut, pos1, actual, 1, true);
var tween_handler:Object = new Tween(btn2, "_x", Strong.easeOut, pos2, actual, 1, true);
var tween_handler:Object = new Tween(btn3, "_x", Strong.easeOut, pos3, actual, 1, true);
var tween_handler:Object = new Tween(btn4, "_x", Strong.easeOut, pos4, actual, 1, true);
var tween_handler:Object = new Tween(btn5, "_x", Strong.easeOut, pos5, actual, 1, true);
}

function salir()
{
var tween_handler:Object = new Tween(btn1, "_x", Strong.easeOut, actual, pos1, 1, true);
var tween_handler:Object = new Tween(btn2, "_x", Strong.easeOut, actual, pos2, 1, true);
var tween_handler:Object = new Tween(btn3, "_x", Strong.easeOut, actual, pos3, 1, true);
var tween_handler:Object = new Tween(btn4, "_x", Strong.easeOut, actual, pos4, 1, true);
var tween_handler:Object = new Tween(btn5, "_x", Strong.easeOut, actual, pos5, 1, true);
}