# Recursive Tween

**URL:** <https://forum.kirupa.com/t/recursive-tween/250129>\
**Category:** Uncategorized\
**Created:** [January 25, 2008, 8:47pm UTC](https://forum.kirupa.com/t/recursive-tween/250129 "2008-01-25T20:47:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![el\_endemoniau](https://avatars.discourse-cdn.com/v4/letter/e/50afbb/32.png) [@el\_endemoniau](https://forum.kirupa.com/u/el_endemoniau)\
**Post date:** [January 25, 2008, 8:47pm UTC](https://forum.kirupa.com/t/recursive-tween/250129/1 "2008-01-25T20:47:48Z")

</div>

I’m trying to move from AS2 to AS3. I have a MC “an\_top” with 6 keyframes, each frame with a MC called “traced”+currentframe. I need to tween alpha of “traced” mc to 0 then go to next frame and tween alpha over again, till reach last frame and again loop from start . But i must be missing something and confused, it’s works only at the first frame :wasted:

function animar\_top(cuadro:int):void{  
var objeto:DisplayObject=an\_top.getChildByName(“traced”+cuadro);  
var t\_alpha:Tween = new Tween(objeto, “alpha”, Elastic.easeOut, 5, 0, 3, true);  
t\_alpha.addEventListener(TweenEvent.MOTION\_FINISH, t\_alpha\_termina);  
}

function t\_alpha\_termina(event:TweenEvent):void{  
var tween:Tween = Tween(event);  
an\_top.gotoAndPlay(an\_top.nextFrame);  
animar\_top(an\_top.currentFrame);  
tween.removeEventListener(TweenEvent.MOTION\_FINISH, t\_alpha\_termina);  
}

help! :hangover:
