1 Reply Latest reply on Jun 5, 2007 8:37 AM by Gorka Ludlow

    How to maintain position when scaling?

    illtrax Level 1
      How to maintain position when scaling?
      How to have an MC stay bottom/center to the browser no matter the size?

      I have been searching the universe for an answer to my alignment issue.

      Firstly, here is an example site.

      http://www.redtettemer.com/

      The object on the left stays horizontal left/ vertical center and the bottom object stays horizontal right / vertical bottom no matter the size of the browser.

      My background image will scale the same way as the example site and I have that working. Just need to know how to align other objects around the perimeter and have a main "loader" in the center of the page.

      Any help would be greatly appreciated. I have looked everywhere for an explanation!

      Thanks

      Here is me background scale code.

        • 1. Re: How to maintain position when scaling?
          Gorka Ludlow
          It's quite easy and you have done most of the work yourself. If you need to move objects around the Stage on the Resize event all you need is to calculate their position in the reference to the stage dimension and the movieclip's.

          To center movieclip:
          movieclip._y = (Stage.height - movieclip._height) / 2;
          movieclip._x = (Stage.width - movieclip._width) / 2;

          Cheers
          Gorka