In my flash project I wanted to introduce small delays between actions performed by the code in a run.
For example:
for(i=0; i<5; ++i) {
someMovieClip[i]._visible = false;
//One second of delay
}
Is it possible to implement this one second delay above? (in AS2)
You would use intervals to do this rather than a for loop. Something like this:
After calling the function for the first time, an interval is set up that calls the function again every second until the condition required to clear the interval is met.
Note that this will not break the execution of any remaining script that comes after the call to
myFunction(), so if that is your intention you should put all the subsequent code into a separate function to be called at the same time as the interval is cleared.