On Wed, Dec 24, 2008 at 4:07 AM, jmfillman <[email protected]> wrote: > This crops the scroll area only for items after the last included > item. Take the following example: > > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > layout="absolute"> > <mx:Canvas left="0" bottom="0" top="0" right="0"> > <mx:Button x="10" y="10" label="Button 1" > includeInLayout="false" visible="false"/> > <mx:Button x="10" y="1000" label="Button 2" > includeInLayout="true" visible="true"/> > <mx:Button x="10" y="1500" label="Button 3" > includeInLayout="true" visible="true"/> > <mx:Button x="10" y="3000" label="Button 4" > includeInLayout="true" visible="true"/> > <mx:Button x="10" y="4000" label="Button 5" > includeInLayout="false" visible="false"/> > </mx:Canvas> > </mx:Application> > > The scrollBar still starts at 0, but does stop just after displaying > Button 3. I need the scroll to start at 1000, and not be able to > scroll less than 1000 and no higher than 3000. While Button 1 is not > visible, the scrollBar still accounts for the space between 0 and > 1000.
I see. Any particular reason for using Canvas? If you're laying them out vertically as in this example, then I think you could use VBox and your problem would be solved (along with visible/includeInLayout). The problem here is that Canvas will start counting from the absolute position of the top-most visible item (y="1000"), so it'll still leave 1000 px. blank space. You don't have that with VBox. > I'm trying to make scrollRect crop the canvas. I'm able to restrict > the view, but I can't make it scroll. Take this example: scrollRect or mask is just not going to work nicely with a Flex container. I wouldn't go there at all. -- manishjethani.com

