This content has been marked as final. Show 6 replies
Thanks for your answer, but I have tried to "pause" CPU calculation to enable Flash to display the VBox by means of adding each chart in an invocation of callLater() and also by adding the next chart after receiving a addedToStage event. None of this helps. Any comments from the Adobe-guys would help, instead of the "silent-treatment".
I do similar things.
The for loop is not it : you need a 'timed' loop, like onEnterFrame or a simple timer.
What I do is add 4-5 graphs and set up a loop based on the frame update to add one for each of the next n frames. In that loop, you can use invalidate (prob not needed in your scheme) to insure that the VBox is updated:
One way is to have an "iterator" function that actually draws the chart.
Have an instance variable that holds the current iteration index. (also will need an end index) In your chart iterator, use the iterator index to find the data in the XMLList, then draw the chart. Have it call a second function, using callLater(), which checks the iteration against the end index and conditionally calls the chart iterator function.
The callLater() approach does not work, as I said before.
The Timer-approach does work. It seems like a workable solution, the only problem is to estimate the Timer-interval. If the Timer-interval is smaller than it takes to calculate the chart, Flash is not given the time to update the screen and it does does work. In my case it is difficult to estimate the calculation-time, since it depends on the size of the XML passed into the chart.
Therefor a cleaner approach would be to add the next chart as the previous chart is is actually DRAWN on the screen. I though I could use the event addedToStage for the chart, but this event seems to be triggered when it is added to the display list only. Is there a similar event that is triggered after a component is actually DRAWN on the screen?
Thanks for your workaround!
Okay, I found the event "updateComplete" which it triggered after it is completely drawn on the screen. That's what I needed!