Adobe Flash Actionscript Flex Examples

ActionScript setInterval and loadMovie
for Rotation of External Image and Movies Such as Ad Rotation

JavaScript and the latest version of the Adobe Flash Player are required. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

This is a basic example of using Actionscript setInterval as a timer to dynamically load a rotation of jpg images for example as an automatic ad rotation.

Although the example uses jpg files it can be used with external swf as well or a combination of swf and jpg files.

The example below was set to rotate three jpg images every 2 seconds and repeat the rotation three times.

Frame 1 of the movie contains the Actionscript and you can change the list of external files to rotation, their order of rotation, the duration each appears and the number of times the rotation will occur.

You can test this within Flash IDE using menu choices Control, Test Movie or publish and test. Place all files in the same folder.

Downloads:
All source files for Flash MX2004: Download
All source files for Flash 8: Download
Search For More Flash Flex Actionscript Examples