# Anyone knows how make a delay in flash?

**URL:** <https://forum.kirupa.com/t/anyone-knows-how-make-a-delay-in-flash/2372>\
**Category:** Uncategorized\
**Created:** [April 13, 2002, 3:47am UTC](https://forum.kirupa.com/t/anyone-knows-how-make-a-delay-in-flash/2372 "2002-04-13T03:47:09Z")\
**Posts on this page:** 17\
**Page:** 1

<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:** [April 13, 2002, 3:47am UTC](https://forum.kirupa.com/t/anyone-knows-how-make-a-delay-in-flash/2372/1 "2002-04-13T03:47:09Z")

</div>

I’d like to have an animated kung fu guy throwing punches…to make the punch look real…apart from using motion tween, is there a script or technique to make it look kinda like a slow motion movement with lots of delay?

help?

---

<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:** [April 13, 2002, 1:51pm UTC](https://forum.kirupa.com/t/anyone-knows-how-make-a-delay-in-flash/2372/2 "2002-04-13T13:51:50Z")

</div>

Do this in each frame:

start = getTimer ();  
while (start+XXXX\>now) {  
now = getTimer ();  
}

Where XXXX is the delay in milliseconds, e.g. 1000 = 1 sec.  
Maybe not the most elegant solution but with this you can tweak the delay individually in each frame, I like it a lot 😉

Achnor

---

<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:** [April 13, 2002, 4:08pm UTC](https://forum.kirupa.com/t/anyone-knows-how-make-a-delay-in-flash/2372/3 "2002-04-13T16:08:01Z")

</div>

Hey Achnor, what is this supposed to do ?

pom 0]

---

<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:** [April 13, 2002, 4:51pm UTC](https://forum.kirupa.com/t/anyone-knows-how-make-a-delay-in-flash/2372/4 "2002-04-13T16:51:19Z")

</div>

It causes a delay? Explain what you don’t understand.

Achnor

---

<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:** [April 13, 2002, 5:13pm UTC](https://forum.kirupa.com/t/anyone-knows-how-make-a-delay-in-flash/2372/5 "2002-04-13T17:13:13Z")

</div>

Beware though, it occupies 100% of your CPU so better not make big delays. I’ve found delays upto 0,5 seconds to work good.

Achnor

---

<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:** [April 13, 2002, 5:34pm UTC](https://forum.kirupa.com/t/anyone-knows-how-make-a-delay-in-flash/2372/6 "2002-04-13T17:34:30Z")

</div>

Oh, you mean you want to keep the CPU working as long as the pause lasts ?? That’s a little bit radical. You have some much more simple ways of doing that… Just putting a stop, timing and then going to the next frame. I didn’t try it, but it should be possible.  
pom 0]

---

<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:** [April 13, 2002, 6:37pm UTC](https://forum.kirupa.com/t/anyone-knows-how-make-a-delay-in-flash/2372/7 "2002-04-13T18:37:08Z")

</div>

Do I sence I bit of sarcasm? 😉

What I meant is that this script runs as fast as it can. It’s not bound by the framerate. If you have a slow computer, the script executes slow but the delay is the same as with a fast computer where the script executes fast.

If you know a better method (stop, timing?) please let me/us know.

Achnor

---

<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:** [April 13, 2002, 8:28pm UTC](https://forum.kirupa.com/t/anyone-knows-how-make-a-delay-in-flash/2372/8 "2002-04-13T20:28:37Z")

</div>

No sarcasm at all, really. Anyway, the method I was mentionning was made by Supra, so I can’t brag or anything… It’s a bit complicated to write, so if you want it, just tell me and I’ll send it to you.  
pom 0]

---

<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:** [April 13, 2002, 9:00pm UTC](https://forum.kirupa.com/t/anyone-knows-how-make-a-delay-in-flash/2372/9 "2002-04-13T21:00:41Z")

</div>

Send it here: [achnor@gmx.net](mailto:achnor@gmx.net)

I have use for delay-scripts all the time and the more the merrier 🙂

Thanks

Achnor

---

<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:** [April 13, 2002, 9:12pm UTC](https://forum.kirupa.com/t/anyone-knows-how-make-a-delay-in-flash/2372/10 "2002-04-13T21:12:59Z")

</div>

sent.  
pom 0]

---

<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:** [April 13, 2002, 10:37pm UTC](https://forum.kirupa.com/t/anyone-knows-how-make-a-delay-in-flash/2372/11 "2002-04-13T22:37:04Z")

</div>

Here is the delay effect result im trying to achieve. However, im doing this by “stacking” one movie on top of the other - and adjusting its alpha levels and frame position.

[www.skillfish.com/delay.swf](http://www.skillfish.com/delay.swf)

I’m wondering if there is a script that can be attached to a moving movie( object) that will produce similar results

thanks 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:** [April 13, 2002, 10:45pm UTC](https://forum.kirupa.com/t/anyone-knows-how-make-a-delay-in-flash/2372/12 "2002-04-13T22:45:16Z")

</div>

duplicateMovieClip, or you can use onion skins…i’m not sure about the onion skin one though…Pom might know…

---

<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:** [April 14, 2002, 12:41am UTC](https://forum.kirupa.com/t/anyone-knows-how-make-a-delay-in-flash/2372/13 "2002-04-14T00:41:01Z")

</div>

Give me your email address, I’ll send you the fla. And yes, Jubby, I checked the profile, it says private :lol:  
Mail me at [ilyas.usal@club-internet.fr](mailto:ilyas.usal@club-internet.fr) if you don’t want to write your address on the board.  
pom 0]

---

<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:** [April 14, 2002, 12:43am UTC](https://forum.kirupa.com/t/anyone-knows-how-make-a-delay-in-flash/2372/14 "2002-04-14T00:43:04Z")

</div>

By the way, this has absolutely nothing to do with what Achnor and I were talking about. A bon entendeur…  
pom 0]

---

<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:** [April 14, 2002, 1:22am UTC](https://forum.kirupa.com/t/anyone-knows-how-make-a-delay-in-flash/2372/15 "2002-04-14T01:22:51Z")

</div>

hey POM… you guys are always so helpful! I try to keep a folder with tips and stuff that I may use in the future. If it’s some cool code, could we still post it out here somewhere?

If not, I’d still love a copy of any code (as long as I know what its supposed to do) for my records.

Thanks a million!

[Iammontoya@yahoo.com](mailto:Iammontoya@yahoo.com)

---

<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:** [April 14, 2002, 3:26am UTC](https://forum.kirupa.com/t/anyone-knows-how-make-a-delay-in-flash/2372/16 "2002-04-14T03:26:33Z")

</div>

thanks for the code.

its very similar to the delay im talking about.- except that it moves with the mouse. Can i extract it and apply it to a movie?

---

<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:** [April 14, 2002, 12:16pm UTC](https://forum.kirupa.com/t/anyone-knows-how-make-a-delay-in-flash/2372/17 "2002-04-14T12:16:59Z")

</div>

Just found this code-snippet. It behaves the same way as the other A/C I posted but without hogging the CPU:

onClipEvent (enterFrame) {  
if (\_root.delay) {  
if (\_root.waitHowLong\<=(getTimer()/1000)-\_root.startTime) {  
// Time is up!  
\_root.delay = false;  
} else {  
// Keep waiting…  
}  
}  
}

Source:  
[www.actionscript.org/tuto…ndex.shtml](http://www.actionscript.org/tutorials/intermediate/delaying_events/index.shtml)
