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?
have you tried upateAfterEvent while dragging??
alot of times that smooths the animation considerbly..
could it be that its calulating too many Depths because of
all the other pieces??
maybe try to set the depth to 0 (zero) for the dragged
object, instead of getNextHighestDepth...
if thats what you are doing... =)