Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/08/2008, 10:58
Avatar de oppjpp
oppjpp
 
Fecha de Ingreso: octubre-2007
Mensajes: 304
Antigüedad: 16 años, 6 meses
Puntos: 2
no me lee el xml

Hola amigos, tengo un pequeño problema, estoy haciendo un buscador en flash y xml, y cuando pongo todo los componentes en el escenario me funciona, el problema se me presenta cuando quiero englobarlo en un MC, no me lee el contenido del xml, les adjunto el codigo a ver si algo esta mal:

Cita:
search_mc._visible = false;
searching._visible = false;
no_found._visible = false;

function load_xml() {
searching._visible = false;
no_found._visible = false;
//
System.useCodepage = true;
sXML = new XML();
sXML.ignoreWhite = true;
sXML.load("search.xml");
sXML.onLoad = function(ok) {
if (ok) {
search();
}
};
}

function search() {
//
found = 0;
total = sXML.firstChild.firstChild.childNodes.length;
s=0;
//
searching._visible = false;
//
for (i=0; i<total; i++) {
//removeMovieClip(_root["mc"+i]);
}
for (i=0; i<total; i++) {
//
search_place = sXML.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue.toString();
//search_place2 = sXML.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue.toString();
//
if (search_place.toLowerCase().indexOf(search_text.te xt.toLowerCase())>-1 || search_place2.toLowerCase().indexOf(search_text.te xt.toLowerCase())>-1) {
found = 1;
search_mc.duplicateMovieClip("mc"+i, i);
search_mc._visible = false;
_root["mc"+i]._y = ((s)*(search_mc._height+10)) + (search_mc._y);
s++;
_root["mc"+i].title = sXML.firstChild.childNodes[i].childNodes[0].firstChild;
_root["mc"+i].description = sXML.firstChild.childNodes[i].childNodes[1].firstChild;

//---------------------------------------------------------------------------------------
}
}
if (found == 0) {
no_found._visible = true;
}
}
un saludo y gracias