# AS2 Help with a timed pause or delay within code

**URL:** https://forum.kirupa.com/t/as2-help-with-a-timed-pause-or-delay-within-code/280140
**Category:** flash
**Created:** [January 23, 2009, 9:48am UTC](https://forum.kirupa.com/t/as2-help-with-a-timed-pause-or-delay-within-code/280140 "2009-01-23T09:48:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tris3d](https://avatars.discourse-cdn.com/v4/letter/t/4da419/32.png) [@tris3d](https://forum.kirupa.com/u/tris3d)
#### Post date: [January 23, 2009, 9:48am UTC](https://forum.kirupa.com/t/as2-help-with-a-timed-pause-or-delay-within-code/280140/1 "2009-01-23T09:48:28Z")

</div>

I was wondering if anyone could help. I’m using this piece of code from a panning source file uploaded to this site while back. I’ve tried to change the code so that after you press the button the movie will slide to a certain point ( 100,100 ) and then the movie will start its motion again ( nMC.startMotion() ) the problem is it doesn’t have time to move to the position before the movieclip startmotion code kicks in. So basically i need some kind of delay in the code! Is this possible? Would really appreciate any help or suggestions.

img.b3.onRelease = function() {  
nMC.slideToPoint(100,100); [COLOR=“Red”]I need a delay here[/COLOR]; nMC.startMotion()

}

Ta

Tris
