# Why menu loses dynamic positioning

**URL:** https://forum.kirupa.com/t/why-menu-loses-dynamic-positioning/318117
**Category:** Uncategorized
**Created:** [January 11, 2011, 3:18am UTC](https://forum.kirupa.com/t/why-menu-loses-dynamic-positioning/318117 "2011-01-11T03:18:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![strawberry](https://avatars.discourse-cdn.com/v4/letter/s/f19dbf/32.png) [@strawberry](https://forum.kirupa.com/u/strawberry)
#### Post date: [January 11, 2011, 3:18am UTC](https://forum.kirupa.com/t/why-menu-loses-dynamic-positioning/318117/1 "2011-01-11T03:18:07Z")

</div>

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

```auto
top_menu.y = 0;
top_menu.x = top_menuXPos / 2;

```

where top\_menuXPos is declared as a variable

```auto
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

```auto
function goAbout (e:MouseEvent):void{
gotoAndStop("About");
}
about_btn.addEventListener(MouseEvent.CLICK, goAbout);

```

then on the corresponding frame:

```auto
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?
