2 Replies Latest reply on Sep 18, 2008 1:14 PM by eexposito

    Combobox losing mouse.roll_over hightlighting

    eexposito
      I have a combobox that I am using to filter some data on a datagrid with a custom itemRenderer:

      <mx:ComboBox id="lgdFilter" width="200" itemRenderer="DropDownRenderer" />

      //Code for DropDownRenderer
      <?xml version="1.0" encoding="utf-8"?>
      <mx:HBox cornerRadius="0" borderStyle="none" backgroundAlpha="1" xmlns:mx=" http://www.adobe.com/2006/mxml" width="100%" height="30" horizontalAlign="left">
      <mx:Script>
      <![CDATA[
      import mx.core.UIComponent;

      static private var black:uint = StyleManager.getColorName("black");

      override public function set data(value:Object):void
      {
      if(value != null)
      {
      this.removeAllChildren();
      var color:uint = value.color;
      super.data = color;
      var uic:UIComponent = new UIComponent();

      if( color != 0 )
      {
      var mySprite:Sprite = new Sprite();
      mySprite.graphics.beginFill(black,1);
      mySprite.graphics.drawCircle(10, 15, 10);
      mySprite.graphics.beginFill(color,1);
      mySprite.graphics.drawCircle(10, 15, 9);
      mySprite.graphics.endFill();
      uic.addChild(mySprite);
      }

      var format1:TextFormat = new TextFormat();
      format1.font = "Verdana";
      format1.size = 12;
      format1.align = "left";

      var lbl:TextField = new TextField();
      lbl.x = 40;
      lbl.y = 5;
      lbl.width = 150;
      lbl.height = 20;
      lbl.border = false;
      lbl.text = value.label;
      lbl.selectable = false;
      lbl.setTextFormat(format1);

      uic.addChild(lbl);
      this.addChild(uic);

      }
      }
      ]]>
      </mx:Script>
      </mx:HBox>


      Everything works great except that when I open the combobox and roll over the non-selected items the background doesn't get highlighted. The selected item does have the usual blue hightlight we expect to see.

      Thanks,
      EE