Tutorial :Ajaxifying flex lists


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.



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.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »