views:

44

answers:

1
+1  Q: 

flex buffered data

Hello,

we are implementing an AIR application in Flex. We populate dynamically a canvas and present it. The problem is that the data are build not before the the change of canvas. Is there a way to buffer the output and present it after the data has been populated?

thanks in advance

+1  A: 

You could do a couple of different things.

1) use states - have a loading data state then once the data has arrived, been processed etc switch to the state with the newly added states. (I wouldn't recommend this approach though as it is a bit of a hack. You could take this approach and use a viewstack or something similar, it would have to be implemented as states (i.e. once the data has been processed go from viewable index 0 to 1 - 0 being the loading state, and 1 being the visual components)

2) better would be to update your UI when you've processed the data. If for some reason the UI isn't updating after you've added/changed some UI components then you need to understand things like invalidateProperties and invalidateDisplayList. I've found this example very good for understanding these technequies. http://www.quietlyscheming.com/blog/components/randomwalk-component/ and http://demo.quietlyscheming.com/RandomWalk/IconWalk.html

kenneth