# How do I make a pause in the timeline?

**URL:** <https://forum.kirupa.com/t/how-do-i-make-a-pause-in-the-timeline/260914>\
**Category:** flash\
**Created:** [May 21, 2008, 12:59am UTC](https://forum.kirupa.com/t/how-do-i-make-a-pause-in-the-timeline/260914 "2008-05-21T00:59:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fs\_tigre](https://avatars.discourse-cdn.com/v4/letter/f/edb3f5/32.png) [@fs\_tigre](https://forum.kirupa.com/u/fs_tigre)\
**Post date:** [May 21, 2008, 12:59am UTC](https://forum.kirupa.com/t/how-do-i-make-a-pause-in-the-timeline/260914/1 "2008-05-21T00:59:19Z")

</div>

Hi,

I am creating a timeline animation and what I want to do is a two second pause in two different keyframes, the problem is that it is only working on the first keyframe.

This is the code I have in the firstkey frame:

this.stop();

var myTimer:Timer = new Timer(2000);  
myTimer.addEventListener(TimerEvent.TIMER, function(event:TimerEvent):void  
{  
play();  
}  
);  
myTimer.start();

* * *

And this is the code I have in my second keyframe:

stop();

myTimer= new Timer(2000);  
myTimer.addEventListener(TimerEvent.TIMER, function(event:TimerEvent):void  
{  
play();  
}  
);  
myTimer.start();

Any idea what could be wrong?  
thanks,

fs\_tigre

---

<div class="post-metadata">

**Author:** ![RebuiltJorge](https://avatars.discourse-cdn.com/v4/letter/r/94ad74/32.png) [@RebuiltJorge](https://forum.kirupa.com/u/RebuiltJorge)\
**Post date:** [May 21, 2008, 4:13am UTC](https://forum.kirupa.com/t/how-do-i-make-a-pause-in-the-timeline/260914/2 "2008-05-21T04:13:16Z")

</div>

here put this code in the first keyframe, it worked for me

```auto
stop();

var frameNumber:int = 1;
var myTimer:Timer = new Timer(2000);
myTimer.addEventListener(TimerEvent.TIMER,delayFrame);
myTimer.start();

function delayFrame(evt:TimerEvent) {
	if (frameNumber == 1) {
		gotoAndStop(2);
		frameNumber = 2;
	} else {
		gotoAndStop(1);
		frameNumber = 1;
	}
}

```

---

<div class="post-metadata">

**Author:** ![Felixz](https://avatars.discourse-cdn.com/v4/letter/f/ecb155/32.png) [@Felixz](https://forum.kirupa.com/u/Felixz)\
**Post date:** [May 21, 2008, 10:58am UTC](https://forum.kirupa.com/t/how-do-i-make-a-pause-in-the-timeline/260914/3 "2008-05-21T10:58:27Z")

</div>

it is enough to place that in first frame

```auto
var myTimer:Timer = new Timer(2000,1);
myTimer.addEventListener(TimerEvent.TIMER, function(event:TimerEvent):void {
play();
}
);

```

when u need to pause just use

```auto
stop();
myTimer.start();

```

In many places

---

<div class="post-metadata">

**Author:** ![fs\_tigre](https://avatars.discourse-cdn.com/v4/letter/f/edb3f5/32.png) [@fs\_tigre](https://forum.kirupa.com/u/fs_tigre)\
**Post date:** [May 21, 2008, 11:40am UTC](https://forum.kirupa.com/t/how-do-i-make-a-pause-in-the-timeline/260914/4 "2008-05-21T11:40:59Z")

</div>

Thank you very much.
