【发布时间】:2014-09-16 21:30:43
【问题描述】:
我有一个 Adobe AIR 应用程序,其中包含一个显示一些在线数据的图表组件。 图表组件必须显示一堆参数,其中大约 10 个。 该应用程序有一个计时器来显示当前系统时间。
图表组件从计时器调用(使用可绑定对象),如下所示。一个单独的可绑定对象用于防止计时器延迟。
private function onTimerEvent(event:TimerEvent):void
{
//Update time in screen
oCurrDate = new Date();
curTime = oDateformatter.format(oCurrDate).toString();
oCurrDate = null;
//oUpdate- Bindable object to inform chart about update
//Call chart every 250 ms
oUpdate.bUpdate = !oUpdate.bUpdate;
}
我在图表的更新事件中使用了 calllater 函数,如下所示。 updateParameter() 将更新每个参数的dataprovider并绘制它。
public function onUpdateEvent(evt:PropertyChangeEvent):void
{
//aPlotIndex set to 0 for first parameter
aPlotIndex.push(0);
this.callLater(updateParameter, aPlotIndex);
}
问题在于计时器和图表更新在运行 20 到 21 天后停止。 20 或 21 天后,更新仅在鼠标移动时发生。当我移动鼠标时,图表中显示的时间和数据都会更新。
我分析了应用程序,发现没有内存泄漏问题。我正在记录所有错误,但我也没有在日志中收到任何错误。一切似乎都很奇怪。
- 是不是因为使用了calllater函数。
- 是不是定时器还在运行,但帧更新没有发生。
我正在使用 Flex SDK3.3 和 Flex AIR 版本 2.0.4.13090。
请指导我解决此问题。
【问题讨论】:
标签: apache-flex air flex3