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'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: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="100%" height="100%" creationComplete="init ();"> <mx:Script> <![CDATA[ private function init():void { myCanvas.scrollRect = new Rectangle(0,0,500, 1700); } ]]> </mx:Script> <mx:Canvas width="100%" height="100%" verticalScrollPolicy="off" horizontalScrollPolicy="off"> <mx:Canvas left="0" right="10" id="myCanvas" top="0" verticalScrollPolicy="on" horizontalScrollPolicy="off" bottom="10"> <mx:Button left="10" y="10" label="Button 1"/> <mx:Button y="1500" label="Button 2" left="10"/> <mx:Button label="Button 3" left="10" y="2550"/> </mx:Canvas> </mx:Canvas> </mx:Application> Where is the vertical scroll bar? --- In [email protected], "Manish Jethani" <manish.jeth...@...> wrote: > > On Wed, Dec 24, 2008 at 2:36 AM, jmfillman <jmfill...@...> wrote: > > I appreciate the responses, but I do not believe this will accomplish > > what I need. Masking is the closest so far, but the scroll bars > > create a problem. > > > > Simply making items hidden, does hide viewable items, but leaves the > > container with a lot of blank space. > > That's exactly why I suggested that, in addition to setting visible to > false, you also set includeInLayout to false. That will "remove" the > items from the canvas and it'll be as if they didn't exist (until you > showed them again). > > What I'm suggesting is the equivalent of CSS's "display: none", if > you're familiar with that. > > -- > manishjethani.com >

