8 Replies Latest reply on May 20, 2011 2:01 PM by jcase16

    Scrollbar

    Dave 81
      If the SWF is higher than the browser window, how can I add a scrollbar in the browser? Thanks!
        • 1. Re: Scrollbar
          Jason Szeto Level 3
          Dave,

          Can you be more specific about your request? The Flash Player is hosted inside of a browser, so it isn't "higher" (which I'm assuming means "on top of") than the browser. You can not explicitly control when the scrollbars of a browser show up. You do have control of when the Flex scrollbars will appear. You can use the vertical/horizontalScrollPolicy properties.

          The browser will sprout scrollbars if the swf stage size is larger than the browser window. The stage size is obtained from the width/height values of the root tag (Application tag).

          • 2. Re: Scrollbar
            Dave 81 Level 1
            My Application tag is:


            <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" height="536" width="1000" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#D4E6FF, #D4E6FF]">


            but the browser doesn't sprout the vertical scrollbar (obviously my resolution is lower than 2500 pixel)
            • 3. Re: Scrollbar
              Dave 81 Level 1
              Sorry, my tag is:

              <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" height="2536" width="1000" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#D4E6FF, #D4E6FF]">
              • 4. Re: Scrollbar
                Peter deHaan Level 4
                Dave 81,

                Try changing your HTML template. If you are using Flex Builder, edit the "index.template.html" file in the "html-template" directory and remove this section (roughly lines 28-30, if you're using the same default template as me):
                <style>
                body { margin: 0px; overflow:hidden }
                </style>

                And then change this:
                <body scroll="no">

                to this:
                <body>

                That should do the trick. Now you should have a 2500px tall Flex app and the browser should have a vertical scrollbar.

                Hope that helps,
                Peter
                • 5. Re: Scrollbar
                  Dave 81 Level 1
                  PERFECT!!!!!!!!!!!!!
                  Thanks!!!!!!!!!!!!
                  • 6. Re: Scrollbar
                    reidabel

                    Anybody know how to do this for Flash Builder 4? The index.template.html file looks different than in the thread above. I tried removing

                     

                    overflow:auto;

                     

                    ... from an area that looked similar to what they were talking about above:

                     

                    <style type="text/css" media="screen">

                      html, body { height:100%; }
                      body { margin:0; padding:0; overflow:auto; text-align:center; background-color: ${bgcolor}; }  
                      #flashContent { display:none; }
                    </style>

                     

                    ... and there was no body/scroll tag to remove. However, it didn't work and I don't see anything else to try in this file.

                     

                    So, does anybody know how to, with Flash Builder 4, make it so that if the browser window height is less than that of the swf height, the browser window has a vertical scroll bar? I tried using verticalScrollPolicy in the s:Application tag, but it doesn't appear to exist.

                    • 7. Re: Scrollbar
                      rmingardo

                      hello there,

                      the fuc... same things today on here as reidabel. ANYONE????

                      • 8. Re: Scrollbar
                        jcase16

                        Same issue as the last two.  How do you do this in Flash Builder 4?