2 Replies Latest reply on Dec 19, 2007 11:55 AM by vtxr1300

    horizontal scroller

    vtxr1300 Level 1
      I have a horizontallist with a custom itemrenderer. The itemrender has an image with some text underneath it. On each side of the horizontallist I have an image that acts as a button. I am trying to figure out how to wire up the buttons to the horizontallist so that if the number of items is greater than it can display, the buttons will allow me to scroll the list left or right. Does anyone know how I could do this? Thanks.
        • 1. Re: horizontal scroller
          vtxr1300 Level 1
          I've done some digging into the class definition for the horizontallist and learned that it has a protected method called scrollHorizontally. I created an as class and overrode that method to see if it would do what I needed and it seems like it would. However, I'm not clear on how to adjust the parameters. Here's what I was able to make of the parameters by using Alert.show(pos.toString() + ":" + deltaPos.toString() + ":" + scrollUp.toString())

          scrollHorizontally(pos:int, deltaPos:int, scrollUp:Boolean)

          When scrollUp is true, it scrolls right, when false, it scrolls left. It seems that deltaPos is always 1, but I'm not sure what that's referring to. When I scroll back and forth the pos value increments by one and starts at zero, so for 5 scrolls to the right my alert is showing 1:1:true, 2:1:true, 3:1:true, 4:1:true, 5:1:true. So, does anyone know how I determine what the value should be for the first parameter, pos? Thanks.
          • 2. Re: horizontal scroller
            vtxr1300 Level 1
            After some more digging I found that this.iterator.bookmark.getViewIndex() will give me the index of the item to the left most position that is viewable. What I can't figure out how to do is get the index of the item to the right that is still viewable to determine if I should scroll to the left any further. I've gone through all the properties in debug mode and I can't seem to find anything that would give me that info. Does anyone have any ideas? Thanks.