4 Replies Latest reply on Nov 8, 2010 12:59 PM by BennyB23

    Detecting hovered index change in DataGrid

    BennyB23 Level 1

      I have a project where I'm using the following code to set and change the text for a label, which appears below a DataGrid:

       

      //videoDG:DataGrid...

      //description:String (a property of the value object in the ArrayCollection)

      //testLabel:Label (the text field)

       

      protected function videoDG_itemRollOverHandler(event:ListEvent):void

      {

      if (event.columnIndex == 0)

           {

                testLabel.text = event.itemRenderer.data.description;

           }

      }

       

      protected function videoDG_itemRollOutHandler(event:ListEvent):void

      {

           testLabel.text = " ";

      }

       

      This works fine, however the function is only triggered when the mouseOver and mouseOut events are discrete (ie; the mouse exits the row and the column, not when the mouse simply moves over the previous or next item in the DataGrid).

       

      If the hovered state of the itemRenderer responds to the mouse, then there's got to be an event associated with the state change, but what is it and how do I reference it in order to fine tune the behavior of the UI? Any suggestions would be appreciated.

       

      Thanks~Benny