2009-10-29 52 views
0

我有一个应用程序,当我点击某个特定的选项卡时,发送了id =“service”的HTTPService。该服务调用一个php文件,该文件反过来从表中提取数据并将其作为xml字符串返回给Flex。 Flex然后使用DataGrid的dataprovider属性来显示dataGrid中的数据。Flex:Timer + HTTPService

我可以有一个计时器的功能,每5分钟后会一次又一次地调用HTTPService吗?

回答

1
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

再次感谢':) – baltoro 2009-10-29 13:50:06

+0

不客气。顺便说一句,你有没有费心检查答案附近的上/下箭头是什么意思? http://meta.stackexchange.com/questions/7237/how-does-reputation-work-on-stackoverflow – Amarghosh 2009-10-29 13:52:39