On Apr 15, 2008, at 12:23 AM, Eric Cooper wrote:
I am wondering, though, if I would get this for "free" if I used
DisplayObject and the built-
in drag events. I am also wondering, if I am saving that much in
terms of memory and
speed, by "rolling my own" as it were.
My personal choice was not to use any of the built-in drag event
stuff for this.
I created my own handler for clicking and 'selecting' or initiating a
drag or other transform on a display object using transformation
matrices. Objects extend some base classes that implement an
interface containing a setTransformation method. Each object can then
override the capabilities of the transformation that is being applied
(as a matrix parameter).
I find it pretty weird you run into issues with more than 10 display
objects. I would imaging you'd have issues with a few hundred or
thousand, but not low single digits.
If you get to really complex vector shapes dragging can slow down
quickly because the renderer has to deal with visibility and
compositing of that complex shape. Bitmap representations here are
much more efficient, using cacheAsBitmap=true (gotta extend
movieclip) and have your class that contains the graphics
automatically handle the drawing of the bitmap into itself. I do this
with text because animating or moving type in a layered 'canvas' has
performance and display issues.
My 0.02.
cheers,
jon