Bueno, este post lo hice hace un rato y el otro dia se me ocurrio retomarlo y encontrarle una solucion, para que no sea de esos post nunka resueltos y aqui esta mi solucion:
aca les dejo el codigo, es sencillo:
Código :
import com.fx.animaciones.easing.*;
import mx.transitions.Tween;
var easing:Array = new Array();
easing.push({label:"no easing", func:Linear.easeNone});
easing.push({label:"in quad", func:Quad.easeIn});
easing.push({label:"out quad", func:Quad.easeOut});
easing.push({label:"in-out quad", func:Quad.easeInOut});
easing.push({label:"in cubic", func:Cubic.easeIn});
easing.push({label:"out cubic", func:Cubic.easeOut});
easing.push({label:"in-out cubic", func:Cubic.easeInOut});
easing.push({label:"in quartic", func:Quart.easeIn});
easing.push({label:"out quartic", func:Quart.easeOut});
easing.push({label:"out-in quartic", func:Quart.easeInOut});
easing.push({label:"in quintic", func:Quint.easeIn});
easing.push({label:"out quintic", func:Quint.easeOut});
easing.push({label:"in-out quintic", func:Quint.easeInOut});
easing.push({label:"in elastic", func:Elastic.easeIn});
easing.push({label:"out elastic", func:Elastic.easeOut});
easing.push({label:"in-out elastic", func:Elastic.easeInOut});
easing.push({label:"in back", func:Back.easeIn});
easing.push({label:"out back", func:Back.easeOut});
easing.push({label:"in-out back", func:Back.easeInOut});
easing.push({label:"in bounce", func:Bounce.easeIn});
easing.push({label:"out bounce", func:Bounce.easeOut});
easing.push({label:"in-out bounce", func:Bounce.easeInOut});
for(var i:Number = 0; i < easing.length; i++)
{
_cb.addItem({label:easing[i].label, data:i});
}
_cb.addEventListener("change", this);
_cb.addEventListener("close", this);
_cb.rowCount = 7;
function change( obj:Object )
{
var i:Number = obj.target.getSelectedItem()["data"];
this.graficar( easing[i].func );
}
createEmptyMovieClip("grafica_mc", 1);
grafica_mc._y = 230;
grafica_mc._x = 30;
function graficar( aux:Function ):Void
{
grafica_mc.clear();
grafica_mc.lineStyle(0, 0x0000FF, 100);
grafica_mc.moveTo(0, 0);
for( var tiempo = 0; tiempo <= 50; tiempo++)
{
grafica_mc.lineTo( tiempo * 10 , aux(tiempo, 0, 200, 50) * -1 );
}
grafica_mc._width = 200;
}
this.graficar( Linear.easeNone );
function close( Void ):Void
{
if( tw_mc == undefined )
{
this.createEmptyMovieClip("tw_mc", 3);
tw_mc.lineStyle(3,0x00FFCC);
tw_mc.lineTo(200,0);
tw_mc._x = 30;
}
tw_mc._tween.stop();
tw_mc._tween = new Tween( tw_mc, "_y", easing[_cb.getSelectedItem()["data"]].func, 230, 30, 2, true )
}
Si alguien necesita el archivo fla, puede pedirmelo, nos vemos pronto saludos