www.esedeerre.com/menu.xml
y el código del flash (flash
Código :
menuXml = new XML();
menuXml.ignoreWhite = true;
//Cargo botones principales
menuXml.onLoad = function() {
i=0;
while(menuXml.firstChild.childNodes[i].nodeName != undefined){
NombreBoton = menuXml.firstChild.childNodes[i].nodeName;
duplicateMovieClip(Principal_mc,"Principal_mc"+i,i);
eval("Principal_mc" + i)._x = 20;
eval("Principal_mc" + i)._y = i * Principal_mc._height +20;
eval("Principal_mc" + i + ".Texto_txt").text = NombreBoton
i++;
_global.NumeroNodos = i;
}
}
_global.CargarSubMenu = function(prof){
for(i=NumeroNodos;i<=NumeroNodos+100;i++){
removeMovieClip(getInstanceAtDepth(i));
}
i = 0;
while(menuXml.firstChild.childNodes[prof].childNodes[i].nodeName != undefined){
NombreBoton = menuXml.firstChild.childNodes[prof].childNodes[i].attributes.label;
duplicateMovieClip(Secundario_mc,"Secundario_mc"+i,i + NumeroNodos);
eval("Secundario_mc" + i)._x = 30;
eval("Secundario_mc" + i)._y = i * Secundario_mc._height + (prof + 1) * Principal_mc._height +20;
eval("Secundario_mc" + i + ".Texto_txt").text = NombreBoton
i++;
}
//prof + 1: Numero de botones grandes
//i: Numero de botones pequeños
j = 0;
while(menuXml.firstChild.childNodes[j].nodeName != undefined){
j++;
aux = j;
eval("Principal_mc" + aux)._x = 20;
eval("Principal_mc" + aux)._y =(aux ) * Principal_mc._height + 20;
if(prof < j){
eval("Principal_mc" + aux)._y += i * Secundario_mc._height;
}
}
}Buena suerte y hasta luego
