2 Replies Latest reply on Jun 23, 2008 1:00 AM by cedric.c

    quick display


      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 application.

      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 blocking functionality.

      - 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 simple code)

      I'm looking for a solution which would permit me to get a faster and smooth display.

        • 1. Re: quick display
          matthew horn Level 3
          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() method.

          Maybe others could chime in here and suggest other ways to improve the time.

          matt horn
          flex docs
          • 2. Re: quick display
            cedric.c Level 1
            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...