4 Replies Latest reply on Nov 3, 2011 6:54 AM by kglad

    Scrol Bars of ScrollPane

    Mughal Shahzad

      Hi,

       

      In my last post kglad which is a Flash expertise told me how to dynamicaly load images in movieclips and display in ScrollPane, its done, but I have another issue regarding to ScrollPane,

       

      How to show its Horizontal/Vertical scroll bars.

       

      Right now ScrollPane automatically resizes as per the image size which is being loaded into it

       

      Regards,

      Shahzad

        • 1. Re: Scrol Bars of ScrollPane
          Ned Murphy Adobe Community Professional & MVP

          Look up the Scrollpane component in the Flash help documnts and review all of the properties that support it.  You should find some that define the scrolling policies and the sizing as well.  There could be examples to help you work things out too.

          • 2. Re: Scrol Bars of ScrollPane
            kglad Adobe Community Professional & MVP

            use the setSize() method to assign a size to your scrollpane.  for example, for a scrollpane with instance name sp:

             

            sp.setSize(300,300);

            • 3. Re: Scrol Bars of ScrollPane
              Mughal Shahzad Level 1

              Hi Sir,

               

              Its not working, still automaticaly resizes, have a look at following code

               

              imgInd = 1;

               

              mcPrv.onRelease = function() {   

                  if (imgInd>=1) {

                      sp.setSize(333,333);

                      var mc:MovieClip = sp.depthChild0.createEmptyMovieClip("mc", 1);       

                      mc.loadMovie("images/img"+imgInd+".jpg");

                      imgInd -= 1;

                  }

              };

              mcNxt.onRelease = function() {   

                  if (imgInd<=6) {

                      sp.setSize(333,333);

                      var mc:MovieClip = sp.depthChild0.createEmptyMovieClip("mc", 1);

                      mc.loadMovie("images/img"+imgInd+".jpg");

                     

                      imgInd += 1;

                  }

              };

              • 4. Re: Scrol Bars of ScrollPane
                kglad Adobe Community Professional & MVP

                use:

                 

                 

                imgInd = 1;

                sp.setSize(333,333);

                 

                mcPrv.onRelease = function() {   

                    if (imgInd>=1) {

                      

                sp.contentPath="images/img"+imgInd+".jpg";

                        imgInd -= 1;

                    }

                };

                mcNxt.onRelease = function() {   

                    if (imgInd<=6) {

                        sp.contentPath="images/img"+imgInd+".jpg";

                        imgInd += 1;

                    }

                };

                1 person found this helpful