# \[simple\] first do "something", when complete do something else

**URL:** <https://forum.kirupa.com/t/simple-first-do-something-when-complete-do-something-else/288673>\
**Category:** flash\
**Created:** [May 19, 2009, 6:42pm UTC](https://forum.kirupa.com/t/simple-first-do-something-when-complete-do-something-else/288673 "2009-05-19T18:42:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![omgnoseat](https://avatars.discourse-cdn.com/v4/letter/o/5fc32e/32.png) [@omgnoseat](https://forum.kirupa.com/u/omgnoseat)\
**Post date:** [May 19, 2009, 6:42pm UTC](https://forum.kirupa.com/t/simple-first-do-something-when-complete-do-something-else/288673/1 "2009-05-19T18:42:04Z")

</div>

Right, like the topic states I got quite a simple question that I can’t figure out myself.

I have a movieclip with an animation in it, animation1 for now. At frame 15 of that animation there is another movieclip, animation2. When animation 1 is done, animation 2 should play from frame 2.

When I press a button, animation 1 plays and stops at frame 15, from there the animation 2 should play from frame 2.

Quite easy… but can’t figure it out without getting errors =/

```auto
//event listeners
button.addEventListener(MouseEvent.CLICK, playAnimation);

function playAnimation(event:MouseEvent):void {
    Animation1.gotoAndPlay(2);
    //somehow play animation 2 when animation 1 is done
   Animation1.Animation2.gotoAndStop(2);
}

```

Hope anyone can clear this up for me 🙂
