1 Reply Latest reply on Jun 1, 2009 4:16 PM by -Hob

    List items with delete icon

    istrasci Level 1

      I'm trying to do something kind of advanced (in my mind, at least)...  I want to make a list where each item has no icon, but if you hover your mouse over it, it shows a delete icon that when clicked on would run some code...

       

      I tried messing around with some combination of iconFunctions and itemRenderers, but with no luck...  The closest I could get was when hovering over an item, ALL items would show the (delete) icon, but I couldn't get it to work for the currently-being-hovered-over item...

       

      Has anyone done this before?  This almost seems like something "common" for "Web 2.0" stuff...  If not, anyone have any advice on how to implement this???

       

      TIA

        • 1. Re: List items with delete icon
          -Hob Level 1

          You'll have to create a custom item renderer that listens for a ROLL_OVER event, and unhides the icon in question.  Then, of course, hides it again on ROLL_OUT.  Then just set the itemRenderer for your list to your new class:

           

          in MXML:

           

          <List itemRenderer="MyItemRendererClass"/>

           

          in AS:

          var list:List = new List();

          var itemRenderer = new ClassFactory(MyItemRendererClass);

          list.itemRenderer = itemRenderer;

           

          Hope that helps.

           

          -Hob