I have looked at threads if I didnt see the one that will help please post. Having trouble having a container_mc center on stage correctly. I followed goto’s tutorial and cant get the container_mc to center correctly. Also upon opening the window it doesnt seem to size right until you readjust the window then it will move to different location but still not in the center. Here is my AS:
import flash.display.BitmapData;
container._x = Stage.width / 2;
container._y = Stage.height / 2;
var tile:BitmapData = BitmapData.loadBitmap("tile");
function fillBG() {
this.beginBitmapFill(tile);
this.moveTo(0,0);
this.lineTo(Stage.width,0);
this.lineTo(Stage.width,Stage.height);
this.lineTo(0,Stage.height);
this.lineTo(0,0);
this.endFill();
}
fillBG();
var stageL:Object = new Object();
stageL.onResize = function() {
fillBG();
container._x = Stage.width / 2;
container._y = Stage.height / 2;
}
Stage.addListener(stageL);
I have also tried adding
container._x = (Stage.width / 2) - Stage.width / 2 ;
container._y = (Stage.height / 2) - Stage.height / 2;
but still it doesnt funtion right. Help… thanks in advance MT