2 Replies Latest reply on Sep 14, 2007 2:35 AM by Tim_De_Roeck

    Can  Alpha be set for List selectionColor

    jacksonakj
      I am using a list with the backgroundAlpha="0.0", so that is shows the background image through the list. I want to also make the selectionColor transparent, but cannot find a property to either disable the selectionColor or make it transparent. I found the 'selectable' property, but I still want my list to be selectable. Is this possible?

      <mx:List id="workMenuList"
      dataProvider="{portfolio.works}"
      itemRenderer="WorkMenuItemRenderer"
      columnWidth="195"
      backgroundAlpha="0.0"
      verticalAlign="middle"
      useRollOver="false"
      focusAlpha="0.0"
      focusEnabled="false"
      selectable="true"
      rowCount="{portfolio.works.length}">
      </mx:List>
        • 1. Re: Can  Alpha be set for List selectionColor
          ov.c
          I'm having the same problem... anyone?
          • 2. Re: Can  Alpha be set for List selectionColor
            Tim_De_Roeck
            This works for me:

            ] MXML
            <mx:List itemRenderer="com.renderers.CustomListItemRenderer">

            ] Code
            package com.renderers {

            import mx.controls.listClasses.ListItemRenderer;

            public class CustomListItemRenderer extends ListItemRenderer {

            public function CustomListItemRenderer() {
            super();
            }

            override protected function updateDisplayList(unscaledWidth:Number,unscaledHeight:Number): void {
            super.updateDisplayList(unscaledWidth,unscaledHeight);
            var selectionLayer:FlexSprite = FlexSprite(parent.getChildByName("selectionLayer"));
            for(var i:int = 0; i < selectionLayer.numChildren; i++) {
            var selectionIndicator:SpriteAsset = SpriteAsset(selectionLayer.getChildAt(i));
            selectionIndicator.visible = false;
            }
            }
            }

            }