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(xxmxxm+yymyym);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]