I raised this same question a while back. The problem is that those custom annotations draw a transparent rectangle over the chart and, therefore, the topmost one will catch all the mouse events. The solution is to not draw the transparent rectangle and to attach the the event listener to the chart. You need to do a bit of bounds checking in this case because this will catch clicks on the labels and axes as well but that is the solution.
Cheers, Graham --- In [email protected], "durnelln" <[EMAIL PROTECTED]> wrote: > > Hi all, > > I am hoping to build a suite of custom chart annotations and allow the > user to turn each one off and on as required. As a starting point I > had a look at Ely's wonderful chart sampler on quietlyscheming.com and > how he created his custom annotation (the one which shows crosshairs > when the mouse is over the chart and allows the user to select a range). > > I thought to start with I'd split this functionality into two - i.e. > have separate annotation elements for the crosshairs and the range > selector - this way the user could use one or the other (or both). > > The problem is that each annotation element works fine on its own but > if they are both added to the chart's <annotationElements> array then > only the one on top seems to receive mouse events, i.e: > > <mx:annotationElements> > <test:RangeSelector/> > <test:Crosshairs/> > </mx:annotationElements> > > ...gives me only crosshairs, and: > > <mx:annotationElements> > <test:Crosshairs/> > <test:RangeSelector/> > </mx:annotationElements> > > ...gives me the ability to select the range but no crosshairs appear. > > Does anyone know how I can capture mouse events in *all* active > annotation elements? > > Thanks, > > Nick. >

