【问题标题】:Flex: Timer + HTTPServiceFlex:定时器+HTTPService
【发布时间】:2009-10-29 10:36:59
【问题描述】:

我有一个应用程序,当我单击特定选项卡时,会发送一个具有 id="service" 的 HTTPService。该服务调用一个 php 文件,该文件依次从表中提取数据并作为 xml 字符串返回给 Flex。然后 Flex 使用 DataGrid 的 dataprovider 属性来显示 dataGrid 中的数据。

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

【问题讨论】:

    标签: apache-flex


    【解决方案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();
    }
    

    【讨论】:

    猜你喜欢
    • 2010-09-21
    • 1970-01-01
    • 2010-11-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-18
    • 2010-09-13
    相关资源
    最近更新 更多