Problema con menú XML en Flash 8
porque no funciona mi menu xml en flash 8? no encuentro nada en google ni en libros.
<code>//Create and format the XML object
importXML = new XML();
importXML.ignoreWhite = true;
//Make a handler to manage incoming data
importXML.onLoad = function(success) {
if (success) {
// Transfer the xml content into 'xmlContent'
var xmlContent = this.firstChild;
//trace(this.firstChild.childNodes.length);
// Put the content into an array
menuContent = new Array();
for (var i = 0; i<this.firstChild.childNodes.length; i++) {
nextEntry = xmlContent.childNodes[i];
//trace(nextEntry);
menuContent[i] = [nextEntry.attributes.name, nextEntry.attributes.value];
}
trace(menuContent);
// Identify the total number of menu items
menuLength = menuContent.length;
// Control spacing between each menu item
elementspacer = 2;
// Create the menu
var menuItem, yPosition = 100;
//To allow flexibility, create an empty movie clip that will contain the menu
createEmptyMovieClip("clipContainer", 1);
for (var i = 0; i<menuLength; i++) {
clipContainer.attachMovie("element", "menuItem"+i, i);
// Create a shortcut reference to the present movie clip
thisClip = clipContainer["menuItem"+i];
thisClip.menuname = menuContent[i][0];
thisClip.destination = menuContent[i][1];
// Set the vertical position of each movie clip
thisClip._y = yPosition;
yPosition += Math.floor(thisClip._height+elementspacer);
}
} else {
trace("Error loading xml");
}
};
// Called when a menu item is clicked
function setMenu(value) {
getURL("http://"+value, "blank");
}
//Load the XML file
importXML.load("menu.xml");</code>
Isma
Para empezar, así, a 'bote pronto', el <code>System.useCodepage = true;</code>
fuera, ya no se usa. No me he mirado el resto del código, pero eso de momento. ;)
pilarmiranda
cierto cierto!, lo tengo quitado en otros menus, porque directamente le pongo al archivo xml lo de <xml>
gracias!