-
Align loaded movieclip
I was wondering if someone could help me out. I have a movieclip that is loaded into a blank MC. I want to align the loaded movieclip (that is loaded into the blank MC) to center on the stage whenever the stage is resized.
How can I do this?
Thanks!
Jordan
-
That will do the trick just change the 100 to the location where you want it to appear.
blankMc._x = 100;
blankMc._y=100;
-
but that wont center it when the stage resizes will it?
-
in frame one of your actions layer:
Code:
Stage.align = "LT"; //force the flash movie to justify to the top left
Stage.scaleMode = "noScale"; //prevent the movie from scaling its contents
resizeListener = new Object();//create a generic object
resizeListener.onResize = function(){ //give it a function for onResize events
blankMc._x = (Stage.width/2) - (blankMc._width/2); //assumes your registration point in the MC is top left
blankMc._y = (Stage.height/2) - (blankMc._height/2);//assumes your registration point in the MC is top left
}
Stage.addListener("resizeListener");
//any time you want to force an onResize call you can just say
resizeListener.onResize();