Timer using setInterval in Flex

Below example shows to set a time interval to show the values from an Array.

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”absolute”  creationComplete=”onCreate(event)”>
private var Count:int=0; private var ServerTimer;
private function onCreate(e:Event):void
ServerTimer=setInterval(TimerFunction,1000)   // Calling a function after 1 sec.
private function TimerFunction():void
ServerName.text=Count.toString()  //Show the count value in the Label
Count+=1 // Increasing count value by 1
<mx:Label text=”Starting” fontSize=”40″ id=”ServerName”  x=”67″ y=”83″> </mx:Label>



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.