# Pausing then restarting animation

**URL:** https://forum.kirupa.com/t/pausing-then-restarting-animation/57145
**Category:** Uncategorized
**Created:** [July 10, 2004, 7:39pm UTC](https://forum.kirupa.com/t/pausing-then-restarting-animation/57145 "2004-07-10T19:39:07Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![bugjuice](https://avatars.discourse-cdn.com/v4/letter/b/d78d45/32.png) [@bugjuice](https://forum.kirupa.com/u/bugjuice)
#### Post date: [July 10, 2004, 7:39pm UTC](https://forum.kirupa.com/t/pausing-then-restarting-animation/57145/1 "2004-07-10T19:39:07Z")

</div>

heres the scoop i want to delay a function 1 sec after the last function has completed its animations whats the simplest way to code this. Im sort of leaning to set interval but i could be wrong could someone please help thanks

heres the code i have:

* * *

tweenBall();  
function tweenBall() {  
easeType = mx.transitions.easing.Strong.easeOut;  
var begin = 99;  
var end = 0;  
var time = 1;  
var mc = ball\_mc;  
ballTween = new mx.transitions.Tween(mc, “\_xscale”, easeType, begin, end, time, true);  
tweenBall1();  
}  
function tweenBall1() {  
easeType = mx.transitions.easing.Strong.easeOut;  
var begin = 0;  
var end = 99;  
var time = 1;  
var mc = xmotion\_mc;  
ballTween = new mx.transitions.Tween(mc, “\_xscale”, easeType, begin, end, time, true);  
tweenBall2();  
}  
stop();  
function tweenBall2() {  
easeType = mx.transitions.easing.Strong.easeOut;  
var begin = 0;  
var end = 99;  
var time = 1;  
var mc = \_xinteractive\_mc;  
ballTween = new mx.transitions.Tween(mc, “\_xscale”, easeType, begin, end, time, true);  
}  
stop();

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 11, 2004, 9:28pm UTC](https://forum.kirupa.com/t/pausing-then-restarting-animation/57145/2 "2004-07-11T21:28:38Z")

</div>

I haven’t looked through your code, but from your description, you could just have the function you want to call 1 second later called using setInterval() as you suggested. But then in the same function, you should have the function delete the setInterval, so it only executes once.

intervalID = setInterval(delayed, 1000);

function delayed(){  
// Your code here;  
clearInterval(intervalID);  
}

hope this helps. 🙂
