tags:

views:

476

answers:

2

I am creating a project in Flex.

I have a main page from which i open a popup window on button click. i this pop up window to display my data which i am getting from my Http request in my response() as rawdata. I did broke this data into array.

I can display the data everytime i close the popup window and open it again. But to do it at run time -- is the problem. I did tried to call the request.sent() again and again in a for loop, and it works, but it tends to send alot of http request, that is not good i believe.

can anyone please help me wiht this Flex problem.

Best Zeeshan

+1  A: 

If you send one request you should get one response

If you want to re-display that response over and over to the user - I would suggest using a Timer Task...Have the task run every so many milliseconds and do an Alert.Display(data)

PSU_Kardi
you are suggesting to send a http request again and again to the server??
Zeeshan Rang
i saw some in for flex examples, "run time dashboard" i want to make something like that.. but i did not understand how that thing is working, and how can i have that kind of functionality in my code.
Zeeshan Rang
+1  A: 

You might want to use a framework like PureMVC or Cairngorm for separation of model and view. You want some non-UI actionscript code to be managing the requests and (if necessary) caching of the data. This way you can display the data in any view you like. Difficult to illustrate in a simple response, but check out wikipedia for the basics: http://en.wikipedia.org/wiki/Model_view_controller

If opening a popup requires the data to be refreshed, then you issue a data-refresh command and wait for the response. If you have the data, and it's not stale, you just need to display it and not make needless HTTP requests.

Glenn