# Animation

**URL:** <https://forum.kirupa.com/t/animation/287141>\
**Category:** Uncategorized\
**Created:** [April 27, 2009, 6:53am UTC](https://forum.kirupa.com/t/animation/287141 "2009-04-27T06:53:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dilpreet](https://avatars.discourse-cdn.com/v4/letter/d/51bf81/32.png) [@dilpreet](https://forum.kirupa.com/u/dilpreet)\
**Post date:** [April 27, 2009, 6:53am UTC](https://forum.kirupa.com/t/animation/287141/1 "2009-04-27T06:53:19Z")

</div>

hey

i have a over and out animation but i only want to play the out animation when the over animation has completely finished and the same with out animation.

i have this code

```auto
    
[LEFT]text_mc.buttonMode = true;
text_mc.addEventListener(MouseEvent.ROLL_OVER, textOver);

function textOver(e:MouseEvent):void
{
    e.currentTarget.gotoAndPlay("over");
    text_mc.addEventListener(MouseEvent.ROLL_OUT, textOut);
    text_mc.removeEventListener(MouseEvent.ROLL_OVER, textOver);
}

function textOut(e:MouseEvent):void
{
    e.currentTarget.gotoAndPlay("out");
    text_mc.addEventListener(MouseEvent.ROLL_OVER, textOver);
    text_mc.removeEventListener(MouseEvent.ROLL_OUT, textOut);  
}[/LEFT]

```
