# Timing delay in flash MX

**URL:** <https://forum.kirupa.com/t/timing-delay-in-flash-mx/23059>\
**Category:** Uncategorized\
**Created:** [June 12, 2003, 9:32am UTC](https://forum.kirupa.com/t/timing-delay-in-flash-mx/23059 "2003-06-12T09:32:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![m0fe](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@m0fe](https://forum.kirupa.com/u/m0fe)\
**Post date:** [June 12, 2003, 9:32am UTC](https://forum.kirupa.com/t/timing-delay-in-flash-mx/23059/1 "2003-06-12T09:32:10Z")

</div>

hi ppl of the forum i have a little Query. iv looked on the past forum posts but the solution i found did’nt work “for me”.

I was wondering how to delay an action with actioniscript i.e. press wait 10seconds then perform action/function i have a crude way but i it calls for animating in the time line and i want to do as little of that as possible

Thanx in advance

---

<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:** [June 12, 2003, 9:52am UTC](https://forum.kirupa.com/t/timing-delay-in-flash-mx/23059/2 "2003-06-12T09:52:06Z")

</div>

Hi,  
If you are using MX you can use setInterval(), or if in Flash5, you can user getTimer();  
There are posts and tutes on this site for both, if you cannot get it to work properly, post again

SteveD

---

<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:** [June 12, 2003, 9:59am UTC](https://forum.kirupa.com/t/timing-delay-in-flash-mx/23059/3 "2003-06-12T09:59:57Z")

</div>

thank for the quick responce i tried this

Function moveFrames(){  
if(\_currentframe == 1){  
gotoAndStop(2);  
} else {  
gotoAndStop(1);  
}  
}  
setInterval (moveFrames, 5000);

on the first frame of a movie to test it out but i get this error

Scene=Scene 1, Layer=actions, Frame=1: Line 1: ‘;’ expected  
Function moveFrames(){

i can’t see what’s wrong with it may b cus im new to AS

thanx again

---

<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:** [June 12, 2003, 10:13am UTC](https://forum.kirupa.com/t/timing-delay-in-flash-mx/23059/4 "2003-06-12T10:13:34Z")

</div>

Hi,  
The reason for the error is your have used a captial F in function, try it in lower case and the error will not exist.  
However your code will not work, try setting it up like this:  
[AS]  
//frame1  
stop()  
moveFrames = 5000;  
delay = setInterval(this, “nextFrame”, moveFrames);

//frame2  
moveFrames = 5000;  
delay = setInterval(this, “prevframe”, moveFrames);  
[/AS]  
then once you see how that works you can start to write a function to add to it, or leave it as it is of course

SteveD

---

<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:** [June 12, 2003, 10:21am UTC](https://forum.kirupa.com/t/timing-delay-in-flash-mx/23059/5 "2003-06-12T10:21:21Z")

</div>

thanx im gona have a little play around with it

this forum is wicked. it’s the best flash forum. even better than the macromedia one

---

<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:** [June 12, 2003, 10:39am UTC](https://forum.kirupa.com/t/timing-delay-in-flash-mx/23059/6 "2003-06-12T10:39:10Z")

</div>

Your welcome
