Just add an event listener to the label; before you push it to the
array:

var annotations:Array = new Array();

var lbl:Label = new Label();
lbl.text = "annotation";
lbl.addEventListener(MouseEvent.CLICK,onAnnotationClick);
annotations.push(lbl);
myChart.annotationElements = annotations;

private function onAnnotationClick(event:MouseEvent) : void
{
         Alert.show("I got clicked");
}

-TH

--- In flexcoders@yahoogroups.com, "blc187" <[EMAIL PROTECTED]> wrote:
>
> Using annotations in a chart, creating a few labels and assigning them
> to the annotation property of my line chart.
>
> var annotations:Array = new Array();
> var lbl:Label = new Label();
> lbl.text = "annotation";
> annotations.push(lbl);
> myChart.annotationElements = annotations;
>
> If I try to listen to mouse events on these annotations, they never
> come through, maybe the chart is swallowing them?
> I'd like to be able to add a CLICK listener to tell when I am clicking
> on the annotation label.
> Any thoughts on how to do this?
>


Reply via email to