1 Reply Latest reply on Jul 18, 2010 1:27 AM by Shongrunden

    Browser scroll bars

    Jorge Raimundo

      Hello all!

       

      I have a spark application that is 100% width and height but also has a minWidth and a minHeight.

       

      I need it to show the browser's scrollbars when the browser window is smaller than minWidth or minHeight but I just can't do it!

       

      Any hint, please?

       

      Best regards,

      Jorge

        • 1. Re: Browser scroll bars
          Shongrunden Adobe Employee

          When you set a width/height on a Flex application that value is then used as the width/height of the SWF in HTML (via JavaScript).  You can see this by looking in your bin-debug folder at the HTML file that is generated for your application:

           

          ...
          swfobject.embedSWF(
          "Repro2.swf", "flashContent",
          "100%", "100%",
          swfVersionStr, xiSwfUrlStr,
          flashvars, params, attributes);
          ...

           

          The 100%, 100% in the JavaScript code listed above is setting the width/height of the SWF.  Notice that minWidth/minHeight isn't reflected at all in the sizing and I believe that is because there is no way to define it consistently across all major browsers (if I remember correctly IE6 doesn't fully support it).

           

          If you think this would be useful I would suggest filing an enhancement request (http://bugs.adobe.com/flex).

           

          In the mean time you might want to look into...

           

          - learning about the CSS min-width/min-height styles
          - writing some custom JavaScript/CSS that detects when the SWF size goes below your minWidth/minHeight and at that time uses JavaScript to change the size of the SWF to the minWidth/minHeight instead of 100%, 100%.
          - using Flex scrollbars instead of browser scrollbars