Hello,

how can i simplify this code:

PHP Code:
stop();

import com.greensock.*;
import com.greensock.easing.*;
import flash.events.MouseEvent;

var 
timeline:TimelineMax= new TimelineMax({paused:true});
var 
timeline1:TimelineMax= new TimelineMax({paused:true});
var 
timeline2:TimelineMax= new TimelineMax({paused:true});

timeline.append(TweenMax.to(alfa,3, {y:150alpha:1ease:Elastic.easeInOut}));
timeline1.append(TweenMax.to(beta,3, {y:200alpha:1ease:Elastic.easeInOut}));
timeline2.append(TweenMax.to(teta,3, {y:200alpha:1ease:Elastic.easeInOut}));

boton.addEventListener(MouseEvent.CLICKprueba);

function 
prueba(e:MouseEvent):void{
    
timeline2.reverse();
    
timeline1.reverse();
    
timeline.play();
}

boton1.addEventListener(MouseEvent.CLICKprueba1);

function 
prueba1(e:MouseEvent):void{
    
timeline.reverse();
    
timeline2.reverse();
    
timeline1.play();
}

boton2.addEventListener(MouseEvent.CLICKprueba2);

function 
prueba2(e:MouseEvent):void{
    
timeline.reverse();
    
timeline1.reverse();
    
timeline2.play();

I think, for loop can be used but i don't know how

Thanks for your help