Do you actually need 1000 - 2000 objects? If not do data paging. Otherwise try
to simulate some threading. Process only chunks of them on enter frame - you
need to write some logis of your own though. Probably not trivial but doable. I
was able to fix my similar issue by loading around 50 -100 objects and only when
thanks for your reply. splitting up the data might be a solution, but this would require major changes of the webservice and currently we're looking for a way to solve this without changing the webservice. so paging is no solution (at least not for the moment).
I've also read about simulating threads in flex, but that seemed a little bit confusing to me...
anyway, the built-in behaviour while downloading is pretty nice, too bad they didn't adopt this for parsing
at the moment I don't have any idea how to get started..
I think I will need to derive from some builtin-classes that manage the webservice-calls and then change the behaviour according to my requirements
unfortunately I don't have that much experience with flex right now..
Normally your web service operations should at least give you the option to set
how manny records to fetch. The paging logic will stay then in the client.
Back to the other option. Your issue is not getting data is taht when you need
to process data your UI freezes. That is because actionscript nature si single
threaded and it freezes everything until it finishes looping through your data.
You need to break that loop. You can do it based on time (e.g. loop for 30 ms -
this is just bogus number), or you can do it based on a certain number e.g when
you already looped 100 times (bogus number againg) break out. Set this login on
the Enter_Frame event handler. So then you will process only certain amounts of
data on every frame and give the player a chance to draw the screen. Now this is
oversimplified. You need to test it to see how it works and tune it...
Unfortunately I don't have an example. When I had the issue I was able to do
Threading is a subject I have not seen covered in any of my FLEX books. Does anyone have any examples or demos of FLEX threading?
The closest you'll get are these links
Implementing something like that is on my personal roadmap but I have noi idea
when I'll find some spare time to do it ...
^ Cheers for that!! I have often thought about writing a FLEX threading class myself...I wish I had more time...
thanks for those links, they're helpful on the topic of "threading-emulation", especially the first one is very good to understand..
I think I would be able to implement such thing in more simple scenarios, like doing a expansive calculation on button click,
but at the moment I'm stuck in an earlier stage - how to "hijack" the existing process of retrieving and parsing the webservice-data (that is nearly entirely done by flex-framework "automatically")
it would be a good point to start if I would know which class provides the parsing of the soap envelope.
I think I will have to derive from that class and overwrite its parsing function with an frame_event based parsing.
I'll tell you if there will be created any useful solution
By the time your result_CallBack is called you should have the data already in
strong typed objects (especially if you generated the server by flex/flash
builder). Are you sure the app hangs there? When I had the issue was after
having the data the data needed further processing. I think that the call is
covered by the busy cursor. It did not happen to me to have issue with the data
during the call itself. One more question are you loading the data on user
demand or on startup ? Actually 2: How are you displaying 2000 obejects on the
I might have been misunderstood about that.
The App hangs between calling my webservice method and waiting for the call to callback handler.
because as you mentioned, there's already a fully populated dataset in the event args when the callback handler is called.
1. call webservice method
2. < app hangs during parsing, not during download>
3. callback handler is executed
that (exactly) is, what makes it so difficult for me, I don't have any idea what's exactly going on during that period.
If you are asking for objects from the webservice, the XML has to be
converted to objects and if that takes a long time it will lock the UI.
How about get XML from Web Servi ce and do you own parsing. It will be easier to
tap into the parsing logic since it's your own.
Still feel better about data paging thoug if there's a small chance to load less