I dont know how to explain this…will try my best…hope someone can help
I am dynamically centering my menu movieclip using the code
top_menu.y = 0;
top_menu.x = top_menuXPos / 2;
where top_menuXPos is declared as a variable
var top_menuXPos:Number = swfWidth - top_menu.width;
now when I click on any button inside my menu movieclip to load an external swf the whole menu shifts to the top left of the stage as it would lose or “reset” from its initial centered position
I have looked into the code and I cannot apparently find any reason of why that is happening…
can someone please help me?
The code inside my menu is this:
example for the buttons
function goAbout (e:MouseEvent):void{
gotoAndStop("About");
}
about_btn.addEventListener(MouseEvent.CLICK, goAbout);
then on the corresponding frame:
slidingPanel_mc.width = stage.width;
slidingPanel_mc.height = stage.height;
slidingPanel_mc.addEventListener(Event.ENTER_FRAME, fl_FadeSymbolIn_2);
slidingPanel_mc.alpha = 0;
function fl_FadeSymbolIn_2(event:Event)
{
slidingPanel_mc.alpha += 0.05;
if(slidingPanel_mc.alpha >= 1)
{
slidingPanel_mc.removeEventListener(Event.ENTER_FRAME, fl_FadeSymbolIn_2);
}
var fl_Loader:Loader;
fl_Loader = new Loader();
fl_Loader.load(new URLRequest("test.swf"));
stage.addChild(fl_Loader);
}
Any idea of why my menu moves and how to correct this?