View Single Post
Nutrox's Avatar Nutrox Nutrox is offline Super Moderator 17 Creative Assets 2005-09-20 #34 Old  
Here's something that might help you out...

ActionScript Code:
  1. stop();
  2.  
  3. Stage.scaleMode = "noscale";
  4. Stage.align = "tl";
  5. Stage.addListener({onResize:reposition});
  6.  
  7. function reposition() {
  8. var header = _root.myHeader_mc;
  9. var content = _root.myContent_mc;
  10. var footer = _root.myFooter_mc;
  11.  
  12. var nPos;
  13.  
  14. nPos = getNewPosition(header);
  15. header._x = nPos.x;
  16. header._y = 0;
  17.  
  18. nPos = getNewPosition(content);
  19. content._x = nPos.x;
  20. content._y = nPos.y;
  21.  
  22. nPos = getNewPosition(footer);
  23. footer._x = nPos.x;
  24. footer._y = Stage.height - footer._height;
  25. };
  26.  
  27. function getNewPosition(mc) {
  28. var newX = Math.floor((Stage.width - mc._width) / 2);
  29. var newY = Math.floor((Stage.height - mc._height) / 2);
  30. return {x:newX, y:newY};
  31. };
  32.  
  33. reposition();
...that will reposition three different movieclips named "myHeader_mc", "myContent_mc", and "myFooter_mc".

All three movieclips will be centred horizontally. myHeader_mc will be fixed at the top of the stage, myContent_mc will be centred vertically, and myFooter_mc will be fixed to the bottom of the stage.

Hope that helps.
Reply With Quote