I’m working on a code to load values from XML to create a menu, I really don’t know how to load only the first 10 values, and then a button for the next 10.
This is my code:
GenerateMenu = function(container, menuname, x, y, depth, xml_element) {
var element;
var entry;
var menu = container.createEmptyMovieClip(menuname, depth);
for (var i=0; i<xml_element.childNodes.length; i++) {
entry = menu.attachMovie("barraMenu","boton"+i+"_mc", i);
entry._x = x;
entry._y = y + i*22;
//entry.trackAsMenu = true;
element = xml_element.childNodes*;
entry.action = element.attributes.action;
entry.variables = element.attributes.variables;
entry.menuname.text = element.attributes.name;
entry.onRollOver = function(){
this.gotoAndPlay(2);
};
entry.onRollOut = entry.onDragOut = function(){
this.gotoAndPlay(11);
};
entry.onRelease = function(){
if (!this.presionado) {
for (x in this._parent) {
this._parent[x].presionado = false;
}
this.presionado = true;
acciones[this.action](this.variables);
trace(this.menuname.text)
};
};
};
};
CreateMainMenu = function(x, y, depth, menu_xml){
GenerateMenu(loader, "mainmenu_mc", x, y, depth, menu_xml.childNodes[0]);
};
thx in advance.