user4976005
user4976005

Reputation:

How to use setTimeout in Flash AS3

In JavaScript:

setTimeout("document.write('example')", 200);

I want to know how I can do a setTimeout in Flash (AS3).

I know there's the Timer() class, but I want a more simple way to do this.

Upvotes: 2

Views: 8749

Answers (1)

BadFeelingAboutThis
BadFeelingAboutThis

Reputation: 14406

setTimeout is exactly the same in flash as it is in JavaScript. It can be found in the flash.utils package.

So:

import flash.utils.setTimeout;

setTimeout(trace,200,"hello world");

eg:

setTimeout(functionToCall, delayInMilliseconds, optionalArgument1, optionalArgument2, etc);

Upvotes: 8

Related Questions