1 Reply Latest reply on Dec 9, 2009 10:38 AM by Flex harUI

    Displaying Last Items in HorizontalList

    Gregory Lafrance Level 6

      I have a HorizontalList with a columnCount of 5 and I am trying to set horizontalScrollPosition so the last five items are displayed in the list.

       

      The following should wor, but it does not:

       

      imagesTL.horizontalScrollPosition = 
         imagesTL.dataProvider.length-imagesTL.columnCount+1;

       

      This does work, but I don't understand why the extra line to increment one more is necessary.

       

      imagesTL.horizontalScrollPosition = 
         imagesTL.dataProvider.length-imagesTL.columnCount+1;
      imagesTL.horizontalScrollPosition++;

       

      Any ideas?