Cargar dos archivos XML en el mismo frame
hola
estoy intentando cargar dos archivos xml en el mismo frame. un archivo es el menu ppal y otro es la subseccion que deberia aparecer al lado.
el caso es que si estas dos cargas estan en el mismo frame, no aparecen.
os digo mis codigos:
CARGA MENU PRINCIPAL
<code>//Create and format the XML object
System.useCodepage = true;
//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("xml/menu_portada.xml");
CARGO XML CON INFORMACION DE LA SUBSECCION
//Create and format the XML object
System.useCodepage = true;
//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, xPosition = 200;
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;
thisClip._x = xPosition;
yPosition += Math.floor(thisClip._height+elementspacer);
}
} else {
trace("Error loading xml");
}
};
function setMenu(value) {
_root.loadMovie(value, "loader_mc");
}
//Load the XML file
importXML.load("xml/noticias_listado.xml");</code>
POR QUÉ NO ME FUNCIONA?
gracias!!
demssite
Creo que sería mejor que pusieses un enlace a un archivo, ya que con este filetazo de código es un lío