0 Replies Latest reply on Jun 17, 2007 5:32 AM by sue69

    Customized LegendItems

    sue69
      I want to create customized LegendItems for a legend of a chart.
      That should includes the marker and an image (logo) instead of the default label. I tried to create a subclass o LegendItem, but it didn't work.
      This is my code, I tried with: (Found in Flex Help)
      It dosen't create my test button in this case. Any suggestions?

      package de.t4media.components.charts
      {
      import mx.charts.LegendItem;
      import mx.controls.Button;


      public class MyLegendItem extends LegendItem

      {


      private var mode_mc:Button;

      public function T4LegendItem()
      {

      //TODO: implement function
      super();
      }

      override protected function createChildren():void {

      // Call the createChildren() method of the superclass.
      super.createChildren();


      // Test for the existence of the children before creating them.
      if (!mode_mc) {
      trace("BUTTON");
      mode_mc = new Button();
      mode_mc.label = "Toggle Editing";
      //mode_mc.addEventListener("click", handleClickEvent);
      // Add the child component to the custom component.
      addChild(mode_mc);
      }
      childrenCreated();
      }
      }
      }