Flex: Timer + HTTPService
I have an application in which when i click on a particular tab an HTTPService having id="service" is sent. This service calls a php file which in turn extracts data from a table and return as xml string to Flex. Flex then use DataGrid's dataprovider attribute to show the data in th开发者_开发百科e dataGrid.
Can i have a functionality of a timer which will call the HTTPService again and again after each 5 minutes?
var timer:Timer = new Timer(5 * 60 * 1000); //time in milliseconds
timer.addEventListener(TimerEvent.TIMER, onTimer);
timer.start();
function onTimer(e:TimerEvent):void
{
service.send();
}
精彩评论