开发者

Ajaxifying flex lists

开发者 https://www.devze.com 2023-01-09 07:54 出处:网络
In html, it\'s possible to use jquery or javascrip开发者_StackOverflowt to refresh a list of stuff every 10 seconds or so to make it appear like it\'s live.

In html, it's possible to use jquery or javascrip开发者_StackOverflowt 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


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.


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.

0

精彩评论

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