package { //Import the classes needed to make this work import flash.display.MovieClip; import flash.utils.Timer; import flash.utils.getTimer; import flash.events.TimerEvent; //Here we setup the class called TimerTest with a capitol T. public class TimerTest extends MovieClip{ //We create the constructor and call the init fuction. public function TimerTest():void{ init(); } //Here we init the timer private function init():void{ //Here we create a new timer triggering every 20 milli seconds var timer:Timer = new Timer(20); //We attach an event listener to the timer timer.addEventListener(TimerEvent.TIMER,onTimer); //We start the timer. timer.start(); } //This function will rotate the shape we made earlier in Flash. //It rotates the shape 5 pixels every 20 milli seconds private function onTimer(evt:TimerEvent):void{ ourShape.rotation += 5; } } }