Flash and AS3 Timer

You need to upgrade your Flash player (v.9 or later) to view this tutorial.

In ActionScript 3.0, the Timer is useful if you want Flash to repeat something at a certain interval of time. You can specify the interval (in milliseconds). You can also specify how many times you want the interval to repeat. In this example, you are given three invitations to click the button. Each invitation appears after a 5-second interval.

Another thing you might do with the Timer is animate something, using only ActionScript (no Timeline).

More information is available from Adobe.

(In AS2 there was something called setInterval; this replaces that. I used to use setInterval to control auto-play slideshows built in Flash.)

DOWNLOAD 160 KB (FLA only): Adobe Flash CS4 required. The FLA contains all the ActionScript, with comments, on frame 1.

Education use: This package was created as an example for my journalism students. It is not intended to be used commercially.

Use and re-use: Flash and AS3 Timer by Mindy McAdams is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.
Creative Commons License

Updated 27 February 2010