# Explanation on one small part of a code

**URL:** <https://forum.kirupa.com/t/explanation-on-one-small-part-of-a-code/211714>\
**Category:** Uncategorized\
**Created:** [January 4, 2007, 2:39pm UTC](https://forum.kirupa.com/t/explanation-on-one-small-part-of-a-code/211714 "2007-01-04T14:39:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rosanna](https://avatars.discourse-cdn.com/v4/letter/r/e0b2c6/32.png) [@rosanna](https://forum.kirupa.com/u/rosanna)\
**Post date:** [January 4, 2007, 2:39pm UTC](https://forum.kirupa.com/t/explanation-on-one-small-part-of-a-code/211714/1 "2007-01-04T14:39:46Z")

</div>

I try to understand this code ( taken from a tuto). I am learning empty mc and AS…:hangover:  
I catch it until a certain point, however some terms are still very very dark for me :  
So as far I see, there are only 2 objects in the file :  
An **empty mc called Menuholder** and a **mc called menuitem** ( a picture for example)  
I can track back those 2 objects in the code, however I can not understand what is the object “menu” doing there ???  
I highlighted it bellow :  
I thank you in advance for your explanation :  
[SIZE=1]align = bottom;  
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[/SIZE][COLOR=black]( **[SIZE=3][COLOR=yellowgreen]“menuitem”, “menu”[/COLOR][/SIZE] +**[/COLOR]i, i);  
[SIZE=1]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;}};  
[/SIZE]
