/ Published in: ActionScript
Centers the main_MC movieclip when stage is resized
Expand |
Embed | Plain Text
// set up Stage.align = "TL"; Stage.scaleMode = "noScale"; // function function center() { var xPos = Stage.width/2 - main_MC._width/2; var yPos = Stage.height/2 - main_MC._height/2; main_MC._x = xPos; main_MC._y = yPos; } // listener var centerListener = new Object(); Stage.addListener(centerListener); centerListener.onResize = function() { center(); }; //default center center();
You need to login to post a comment.
