3 Replies Latest reply on Mar 11, 2010 2:51 AM by s.lanton

    clipAndEnableScrolling

    s.lanton Level 1

      Is there a way to set  clipAndEnableScrolling=true so that the content is clipped only in the horizontal not the vertical

        • 1. Re: clipAndEnableScrolling
          JohanVelthuis

          Not really sure what you mean, you could do this:

           

          <mx:Canvas verticalScrollPolicy="auto" horizontalScrollPolicy="off" >

          content

          </mx:Canvas>

           

          If your content is bigger than the canvas itself it should create a vertical scrollbar, and the horizontal scroll bar will not become visible and will clip your content to the right.

          • 2. Re: clipAndEnableScrolling
            Shongrunden Adobe Employee

            I'm not really sure what your use case is, but you can simulate something like this with two Groups, setting clipAndEnableScrolling to true on the outer Group with a larger height than the inner Group:

             

            <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                           xmlns:s="library://ns.adobe.com/flex/spark">
                
                <!-- Notice that the Button (the large object) looks like it is horizontally
                     clipped at the width of its parent container (100px).  Vertically the 
                     Button does not appear to be clipped since it is showing more than
                     100 pixels high.
                -->
                
                <s:Group id="outerGroup" width="100" height="100%" clipAndEnableScrolling="true">
                    <s:Group id="innerGroup" width="100" height="100">
                        <s:Rect width="100%" height="100%">
                            <s:fill>
                                <s:SolidColor color="red" />
                            </s:fill>
                        </s:Rect>
                        
                        <s:Button label="large object" width="200" height="200" />
                    </s:Group>
                </s:Group>
                
            </s:Application>
            • 3. Re: clipAndEnableScrolling
              s.lanton Level 1

              Thanks that what I needed