How to create a timer in FLEX

In order to add a timer to Flex use the following code:

import flash.utils.Timer;
import flash.events.TimerEvent;

private function createTimer():void {
var myTimer:Timer = new Timer(5000);
myTimer.addEventListener("timer", timerFunc);
myTimer.start();
}

private function timerFunc(evt:TimerEvent):void {
//do something useful here
}

Call the createTimer function when needed