4 Replies Latest reply on Apr 6, 2007 9:34 AM by jlingwai


    jlingwai Level 1
      I want to add scroll bars once my application gets to a certain size....ie 1024X768
      so no matter how small the user minimizes the window or if they have a smaller screen resolution the application will always be 1024x768 but if it is larger it will scale the contents...

      any ideas???

        • 1. Re: Srollbars
          I would try controlling the horizontalScrollBarPolicy="on"/"off" attribute of the display object in a method which is called by a resize event. verticalScrollBarPolicy as well.

          I'm suggesting this because it looks as if the default policy of "auto" is not working for you.

          • 2. Re: Srollbars
            jlingwai Level 1
            yea thanks.....what i end up doing was add and listener for the window resize and adding scroll bars after a certain size.
            • 3. Re: Srollbars
              Hi, I have a similar problem but, I fixed sized my application to be all the webpage but I included a Canvas where I applied a fix width and height.

              Now I applied the verticalScrollPolicy="on" in the <mx:Application> Tag and if My Canvas is 600 px height, and I resize my window to 200 px height, I don't see the scroll bar visible. All I see is an empty scroll bar.

              Any ideas why?
              • 4. Re: Srollbars
                jlingwai Level 1
                thats because they are turn on but there is no content to scroll. In my application I have the app at 100% and i have a canvas that is also 100%. What i did was when the window resizes it calls a resize function. in this function i check the size of the app if it reaches a certain size it fixes the the canvas height and width and adds scroll bars to the application. here is and example of the listener.

                public function resizeEvent(e:ResizeEvent):void{
                if(this.width < 1020){
                cnvApp.width = 1020;
                this.horizontalScrollPolicy = ScrollPolicy.ON;
                cnvApp.percentWidth = 100;
                this.horizontalScrollPolicy = ScrollPolicy.OFF;
                if(this.height < 580){
                cnvApp.height = 580;
                this.verticalScrollPolicy = ScrollPolicy.ON;
                cnvApp.percentHeight = 100;
                this.verticalScrollPolicy = ScrollPolicy.OFF;