开发者

Flex: Timer + HTTPService

开发者 https://www.devze.com 2022-12-09 14:51 出处:网络
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 s

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();
}
0

精彩评论

暂无评论...
验证码 换一张
取 消