I present here a simplified version of my problem. I
developed a little application which is drawing 3000 dots on a
canvas. My big trouble is the execution fastness of this
I tried 2 methods :
- at first, I loop 3000 times, creating and adding
UIComponent objects on the canvas. This takes about 6 seconds. This
delay is too-long for my specifications fastness demand. If
understand correctly flash player mechanism, it's waiting for
making computations before displaying the execution, so that's a
- after, I tried to "oblige" flash player to displaying the
execution with a timer (and a framerate of 50). But this solution
is worst because flex draw again all previous dots already drawn.
Here is my source code (there are not comments, but it's a
I'm looking for a solution which would permit me to get a
faster and smooth display.
I played with the profiler in Flex Builder a little bit and I
think there are some minor improvements you can make. You can
declare uic outside of the 3000 loop, which gave me a 10 to 20%
improvement in the cumulative time of the drawCircleDirect()
Maybe others could chime in here and suggest other ways to
improve the time.
Hi and thank you for your response.
That's right, if I use only one UIComponent to draw my
circles, the display duration is better. But I need to identify
each point (in order to permit click or mouse over events), that's
why I need to draw each point on a single container.
We suggest me to use bitmapData, but I don't know this
object, and I'm always looking for how can I use this...