3 Replies Latest reply on Jun 20, 2006 1:28 AM by Mike Crisp

    Resize Stage on MouseUp

    Mike Crisp Level 1
      Hi

      I'm sure this is simple.

      On frame 1 my stage is 400 x 600.

      When I click continue on MouseUp I want to go to frame 5 and resize / redraw my stage to be 800 x 600

      Should be simple but can I find a straight answer anywhere ...... No ?

      Many thanks

      Mike
        • 1. Re: Resize Stage on MouseUp
          Level 7
          You can use the stage.rect property to describe the size of the stage's
          window. The rect will give you 4 parameters, that describe the left,
          top, right, and, bottom edge locations of your stage on the current
          monitor.

          So, one way to change your stage from 400 X 600 to 800 X 600 would be to
          just add 400 to the value of the right edge. This might work. However,
          it might push the right edge of the stage off the right edge of the
          user's monitor screen.

          You should really look at the the first item in the user's
          desktopRectList. This first item will be the size of the user's first
          monitor screen. They may have more than one monitor, but you will
          usually only care about the first item in the list. You want to make
          sure that the new width and/or height doesn't push the right or bottom
          edge of the movie's stage past the value of the right or bottom edge of
          the user's screen.

          --
          Rob
          _______
          Rob Dillon
          Adobe Community Expert
          http://www.ddg-designs.com
          412-243-9119

          http://www.macromedia.com/software/trial/
          • 2. Re: Resize Stage on MouseUp
            Level 7
            Make a movie script with these handlers. Then you can adjust the stage
            size like so:

            increaseStageRect(400)
            --that will add 400 to the vertical size of the stage

            decreaseStageRect(400)
            --that will reduce the size by 400

            ----

            Though you should do as Rob suggests and make sure that you are not
            making new stage area off the user's screen.

            ----


            on increaseStageRect vAmount
            (the stage).rect=(the stage).rect+rect(0,0,vAmount,0)
            end


            on decreaseStageRect vAmount
            (the stage).rect=(the stage).rect-rect(0,0,vAmount,0)
            end
            • 3. Re: Resize Stage on MouseUp
              Mike Crisp Level 1
              Thanks guys.

              OK.. so I get the concept, but what I'm not getting is where to put what !

              Rob - " one way to change your stage from 400 X 600 to 800 X 600 would be to just add 400 to the value of the right edge. "

              How do I write this ??

              On mouseUp

              ???

              end

              I have tried to search for examples on desktopRectList. but have drawn pretty much a blank.

              Mike - Not sure where to put or what to add to the examples you gave.

              increaseStageRect(400)
              --that will add 400 to the vertical size of the stage

              Is that on a mouseUp event. I need to adjust horizontal not vertical.

              Apologies if I seem a little dumb - all this Football has gone to my Engligh Head !!