I have created two classes that extend ChartElement, one for zooming
and one for panning.  Both work as wanted if applied separately to a
chart using the annotationElements.  However, if I apply both only one
of the two will ever catch a MouseDown rather than both.  I worked out
how to implement the classes in the first place by looking at the
InteractiveBubble example on the Quietly Scheming website
(http://www.quietlyscheming.com/blog/charts/interactive-bubble-chart/).

The jist is that I have overridden the updateDisplayList(..) function
with the following to ensure the Pan or Zoom catches the mouse event:

override protected function updateDisplayList(unscaledWidth:Number,
unscaledHeight:Number):void
        {
                super.updateDisplayList(unscaledWidth,unscaledHeight);
                graphics.clear();
                graphics.moveTo(0,0);
                graphics.beginFill(0,0);
                graphics.drawRect(0,0,unscaledWidth,unscaledHeight);
        }

Clearly the problem I am having when I have two classes using this
same technique being used at the same time is because one of the
"rectangles" is on top of the other.

I realise that combining the pan and zoom into a single class, as is
done in the Quietly Scheming example, would solve the problem but it
is not appropriate for my intensions.

Does anyone have any suggestions for a clean solution?

Reply via email to