3 Replies Latest reply on Mar 6, 2007 3:48 AM by Sketchsta

    Mouse dragging over many movieclips slows to a crawl

    dr deetee Level 1
      I have a system where hundreds of similar movieclips ("pieces") can be mouse dragged around in an area ("dragArea"). I am having trouble with performance.

      When you start dragging a piece, it jumps to the top of the depths so it appears above all the others. All the pieces are created dynamically with createEmptyMovieClip. They are all attached to the dragArea.

      My problem is that the dragging is very slow. The dragged piece updates position very rarely; only when you stop moving the mouse. I thought that this is just because I have so many movieclips, but if I attach one of the pieces to _root and drag that, then it drags very quickly. That is, if I drag it outside dragArea, then it is fast. But as soon as I move it over dragArea, then it becomes slow again.

      This suggests that Flash is doing some complex redrawing when I drag a piece over dragArea. I have tried setting cacheAsBitmap to true for dragArea, but that had no effect.

      I have also tried reducing the number of pieces to one or two. This makes everything fast again.

      Does anyone know why it would become very slow when dragging one piece over dragArea which contains many other pieces?

      Thanks in advance for any help.