ActionScript2 - How to delay the execution (controlling the speed of animation via coding)

hi experts,

i need to make an animation in 10 steps in a for () loop:

for (i=0; i<10; i++)
step i; //whatsoever.....

is there any function to insert it in the loop to control the speed of execution? kinda of delay(xx);   or wait(xx); ?

Many thanks in advance.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Antonio EstradaTech Leader / Senior Web DeveloperCommented:
The only similar things are setInterval() or setTimeout() but those can't be used inside a for loop, it should be something like this:

var i:Number = 0;
var max:Number = 10;
var seconds:Number = 1;
var interval:Number;


function startUp():Void
	 interval = setInterval(countFunc, seconds * 1000);

function countFunc():Void
	if(i == max)

Open in new window

Good luck!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
raulmondaAuthor Commented:
Thank you. Ill look on it to implement it on my project.

Antonio EstradaTech Leader / Senior Web DeveloperCommented:
Glad to help!

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.