# Buttons don't align

**URL:** https://forum.kirupa.com/t/buttons-dont-align/266052
**Category:** flash
**Created:** [July 15, 2008, 8:51pm UTC](https://forum.kirupa.com/t/buttons-dont-align/266052 "2008-07-15T20:51:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![gloqui](https://avatars.discourse-cdn.com/v4/letter/g/97f17d/32.png) [@gloqui](https://forum.kirupa.com/u/gloqui)
#### Post date: [July 15, 2008, 8:51pm UTC](https://forum.kirupa.com/t/buttons-dont-align/266052/1 "2008-07-15T20:51:59Z")

</div>

Hi,

I have a problem with this code that I found for doing a menu kind of like the MAC OS Dock.

centerx = Stage.width/2;  
centery = Stage.height/2;  
menuholder = createEmptyMovieClip(“menuholder”, -1);  
menuholder.\_y = centery;  
menucount = 10;  
menuitems = [];  
miwidth = 20;  
miborder = 1;  
startx = centerx-((menucount-1)_(miwidth+miborder))/2;  
trace(startx);  
for (var i = 0; i\<menucount; i++) {  
var menuitem = menuholder.attachMovie(“menuitem”, “menu”+i, i);  
menuitem.\_x = startx+i_(miwidth+miborder);  
menuitem.id = i;  
menuitem.onRollOver = function() {  
\_root.selected = this;  
};  
menuitems.push(menuitem);  
}  
onEnterFrame = function () {  
var width = 0;  
for (var i = 0; i\<menucount; i++) {  
var xxm = menuitems\*.\_xmouse;  
var yym = menuitems\*.\_ymouse;  
var xm = Math.sqrt(xxm_xxm+yym_yym);  
if (xm\<50) {  
menuitems\*.\_xscale = menuitems\*.\_yscale += ((200-xm)-menuitems\*.\_yscale)/3;  
} else {  
menuitems\*.\_xscale = menuitems\*.\_yscale += (100-menuitems\*.\_yscale)/3;  
}  
width += menuitems\*.\_width;  
}  
width += (menucount-1)_miborder;  
var xpos = Math.round(centerx-width/2);  
for (var i = 0; i\<menucount; i++) {  
xpos += menuitems[i-1].\_width/2+miborder+menuitems_.\_width/2;  
menuitems\*.\_x = xpos;  
}  
};

The problem is that it works fine if the player is 6, but if I export the .swf to version 8 or higher, it’s not working, and I don’t know why. The \_x position of the buttons it’s not changing when I rollover one of the buttons. Any ideas why is this happening?
