1 Reply Latest reply on Mar 7, 2011 9:18 AM by Flex harUI

    How to make the list item have rollover style with underline

    tuliptaurus

      Hi ,

       

      Am using flex builder 3

       

      I have a list..

      and I need to have a list roll over effect so that whenever the user moves over the list item , the particular list item becomes underlined and the font changes

      and the font changes color.

       

      I know there is an itemRollOver and itemRollOut property in the flex list but then how I set styles for the fontDecoration of the list item on rollOver.

       

      Example:

       

       

                  <mx:List id="list" styleName="searchListStyle"

                      creationComplete="this.invalidateDisplayList();"

                      width="100%"

                      dataProvider="{dataProvider_Sources}"

                     itemRollOver="onMouseOver(event)"

                      itemRollOut="onMouseOut(event)"

                      click="onFacetClick(event)"

                      variableRowHeight="true">

                    </mx:List>

       

      and I have the following two functions in my script tag :

       

       

              private function onFacetMouseOver(e:ListEvent):void

              {

                  var currentTarget:Object = e.currentTarget.dataProvider[e.rowIndex];

              }

       

      This in fact returns an list Object selected.

      How will I be able to set the underline of the list item label from this object.

       

      Thanks,

      Ajantha