In a Flex app if you want to call a function after sometime (in seconds or hours) you can use the method setTimeout().The below def shows the use.
Here the method setTimeout() calls the function getmyName after 3 sec in the execution flow.i.e when the line setTimeout reaches in the excution flow then the execution flow calls the function getmyName after 3 sec as mentioned in the method.
The below code example explains the need.
private var alert:Alert;
private function init():void
private function hidealert():void
Here the function init() is called at creationComplete of the app.And it alerts and then waits for 3 sec and closes the Alert window as we are using the setTimeout method and calling a function to close the Alert using the PopUpManager class.
The method setTimeout() can used as our need in the app.leave any comments for suggestions.