# gotoAndPlay onComplete

**URL:** <https://forum.kirupa.com/t/gotoandplay-oncomplete/275050>\
**Category:** flash\
**Created:** [November 8, 2008, 11:55am UTC](https://forum.kirupa.com/t/gotoandplay-oncomplete/275050 "2008-11-08T11:55:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charlotte17](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@Charlotte17](https://forum.kirupa.com/u/Charlotte17)\
**Post date:** [November 8, 2008, 11:55am UTC](https://forum.kirupa.com/t/gotoandplay-oncomplete/275050/1 "2008-11-08T11:55:44Z")

</div>

Hi guys!  
sorry for the strange title but I really don’t know how to call this thread.  
Well, my problem is quite easy. I’ve always created animations by code but now for a work I’ve to create them without using code. The problem is that I don’t know how to create something like “onComplete”.

I have a movieclip and an animation for the Mouse\_over and an animation for the Mouse\_out but [FONT=“Arial”]how can I tell to my script to do the second animation only when the first one is completed[/FONT]?

This is the animation on my frames :

![](http://img352.imageshack.us/img352/3033/88042541xq6.jpg)

and the code that is very simple :

```auto

pulsante_mc.addEventListener(MouseEvent.MOUSE_OVER, pulsanteOver);
pulsante_mc.addEventListener(MouseEvent.MOUSE_OUT, pulsanteOut);
			
function pulsanteOver(evt:MouseEvent):void
{
linguetta_mc.gotoAndPlay(1);
}
			
function pulsanteOut(evt:MouseEvent):void
{
linguetta_mc.gotoAndPlay(18);
}

```

I thought to use a boolean variable, or something like “currentframe” but I really don’t know how. I’ve also searched in the forum but… nothing. So, I hope that someone will help me 🙂
