Actionscript for pause/time-delay?

(Flash 5/Flash MX)

How do I delay/pause using actionscript?

I have tried using a for loop for a time delay like this:

for(i=0;i<1000000;i++){
}

BUT IT DOES NOT WORK!

Flash gives an error like: Time-consuming actionscript. Abort running script? OR the loop simply does not produce a noticeable delay.

Could you please show me how I can introduce a time-delay or a pause using actionscript?

run a search in the forums, javadi82. there a several threads about this. :-\

see this: http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary646.html
and here’s a quick example:

// stop movie
stop();
// play movie after 10 seconds
var myInterval = setInterval(function(){play(),clearInterval(myInterval)}, 10000);

:wink:

could u give the urls to those posts here?

i have tried typing time-delay and pause in the upper right hand corner but that does not help.

thanks anyway.

  1. The link in Kaxs thread (disguised as the word “setInteval”, you really need to stop doing that kax, it gets confusing :stuck_out_tongue: ) is pretty much all you need.

  2. Your using the wrong search field. In the upper left corner there is a button that looks like this…

Click on the button (the one in the corner, not the one in my post) to use the forum search feature.

:stuck_out_tongue:

yeah… i think i should, anyone sees those links. :-\

or maybe something like…
setInterval (the word setInterval is a link!!)
would do… :stuck_out_tongue:

LOL, I think I am the only one that notices you ever do that :stuck_out_tongue:

but I see it as setInterval . there is no setInteval there.

right ?

anyway thanks for showing me the right ‘search’ button.

and to imagine that i visit kirupa.com thrice a day…!

Originally posted by javadi82
**anyway thanks for showing me the right ‘search’ button.

and to imagine that i visit kirupa.com thrice a day…!**

so you found it out, did you? :slight_smile:

Originally posted by lostinbeta
LOL, I think I am the only one that notices you ever do that :stuck_out_tongue:

that’s because we are smart people… :stuck_out_tongue: :wink:

*Originally posted by javadi82 *
**but I see it as setInterval . there is no setInteval there.

right ? **

Click on the word “setInterval” in kax’s original post where it says

see this: setInterval
that word is a link to the macromedia actionscript dictionary of what setInterval is and how it works.

ok… post edited.

now you can clearly see the stupid link. :hair: :stuck_out_tongue:

lol, now you see why I always post my links like that :stuck_out_tongue:

yup… if i ever do that again, please edit my post. :wink: