Ajax 化弹性列表
在 html 中,可以使用 jquery 或 javascript 每 10 秒左右刷新一次内容列表,使其看起来像是实时的。
弹性列表也可以实现同样的效果吗?
我听说可以用其他编程语言创建 Flex。不知道细节是什么,我想他们也是用javascript说的。但我只使用 mxml 和 actionscript,所以我想要一个纯粹的 actionscript/mxml 解决方案。
谢谢
In html, it's possible to use jquery or javascript to refresh a list of stuff every 10 seconds or so to make it appear like it's live.
Is the same thing possible with flex Lists?
I heard it's possible to create flex with other programming language. Not sure what the details were, I think they said with javascript too. But I'm working only with mxml and actionscript, so a pure actionscript/mxml solution is what I'm after.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 Flex 中,您可以使用 HTTPService,而不是挂钩 Javascript。请参阅示例: http: //blog.flexexamples.com/2008/03/29/dynamically-loading-xml-files-using-the-httpservice-tag/
另外,不可能仅使用 Javascript 创建 Flex。还有其他 RIA 工具,但 Flex/AS 需要编译。
In Flex you can use the HTTPService instead of hooking into Javascript. See example: http://blog.flexexamples.com/2008/03/29/dynamically-loading-xml-files-using-the-httpservice-tag/
Also, it is not possible to create Flex with Javascript only. There are other RIA tools out there, but Flex/AS requires compilation.
是的,您可以将 jQuery 与ExternalInterface 结合使用: http://livedocs .adobe.com/flex/3/langref/flash/external/ExternalInterface.html 您可以按需将函数调用从 Flash (Flex) 发送到 JavaScript,以及类似地从 JS 发送到 Fl。如果您的应用程序中有广泛使用的现有 JS 层,我只建议您采用这种方式。
否则我建议你在Flex中进行刷新。使用计时器 (http://livedocs.adobe.com/flex /3/langref/flash/utils/Timer.html)您可以安排这些调用。您还可以测量响应时间并相应地采用刷新时间间隔。
Yes, you can use jQuery with ExternalInterface: http://livedocs.adobe.com/flex/3/langref/flash/external/ExternalInterface.html You can send function calls from Flash (Flex) to JavaScript and similarly from JS to Fl on demand. I'd only suggest to go this way if you have a widely used existing JS layer in your application.
Otherwise I suggest you to do the refreshing in Flex. With Timer (http://livedocs.adobe.com/flex/3/langref/flash/utils/Timer.html) you can schedule those calls. Also you can measure the response time and accordingly adopt the refresh time intervals.