Im having a problem with centering an object in my movie. When it loads in flash player, there is no problem. But when it opens in the internet browser the movie clip isn’t centered and once I go to re size the Internet browser, the code starts to work and centers the movie clip from stage .
This is the code i use to center the movie clip
//Don't scale the movie when the stage size changes
Stage.scaleMode="noScale";
//Align the stage to the top left
Stage.align = "TL";
//Function to toggle between fullscreen and normal size
//the toggle fullscreen button calls this function when pressed
function toggleFullScreen(){
//if normal size, go to fullscreen, else go to normal size
if(Stage["displayState"]=="normal"){
Stage["displayState"]="fullScreen";
}else{
Stage["displayState"]="normal";
}
}
//Create a listener for each time the Stage is resized
var resizeListener:Object = new Object();
//Called each time the stage is resized
resizeListener.onResize = function () {
//Move the button to the center of the screen
background_mc.white_back._x=Stage.width/2;
background_mc.white_back._y=Stage.height/2;
background_mc.tan_back._height=Stage.height * 500;
background_mc.tan_back._width=Stage.width * 500;
}
//Add the listener to Stage
Stage.addListener(resizeListener);
function initScale()
{
function stretchIt()
{
background_mc.header_mc.bg._width = Stage.width;
background_mc.header_mc.head_content._x = Stage.width + 20;
background_mc.header_mc._y = 18;
background_mc.footer_mc.bg._width = Stage.width + 5;
background_mc.footer_mc._y = Stage.height;
background_mc.footer_mc.logo_mov._x = Stage.width - 175;
} // End of the function
var _loc1 = new Object();
_loc1.onResize = function ()
{
stretchIt();
};
Stage.addListener(_loc1);
stretchIt();
} // End of the function
function doSomething1()
{
} // End of the function
setProperty("", _quality, "BEST");
var top;
var left;
var bottom;
var right;
initScale();
MENU.customItems.push(Functioned2);
MENU = new ContextMenu();
MENU.hideBuiltInItems();
Functioned = new ContextMenuItem("All Content Copyright © Justin Long, All Rights Reserved", doSomething1);
MENU.customItems.push(Functioned, Functioned2, Functioned3, Functioned4, Functioned5, Functioned6, Functioned7);
_root.menu = MENU;
stop();