Comunidad de diseño web y desarrollo en internet online

Ayuda con xml y flash

Citar            
MensajeEscrito el 20 Feb 2005 07:03 am
:crap: hola que tal. aqui estoy de nuevo

Pidiendo aayuda, tengo un archivo xml con la siguiente estructura


<fotos>
<carpeta>Imagenes/<carpeta>
<inicio>1</inicio>
<fin>9</fin>
</fotos>


y un codigo AS de la siguiente manera:



obj_xml.onLoad = function(cargo) {


if (cargo) {

m = obj_xml.firstChild.childNodes[0].firstChild.nodeValue;
ini = obj_xml.firstChild.childNodes[1].firstChild.nodeValue;
fin = obj_xml.firstChild.childNodes[2].firstChild.nodeValue;
n="s"+ini+".jpg";
p.contentPath = m+n;
t.text="s"+ini;
trace(m+ " "+ ini+" " + fin)

} else {
trace("Error");
}
}






pero el problema es que las variables ini y fin me dicen que estan en unload osea que no cargo nada ahi. alguien me puede decir por que razon si carga en la variable m,
obj_xml.firstChild.childNodes[0].firstChild.nodeValue

y en la variable ini y fin no carga nada ?

la pregunta en concreto es :

por que en ini y en fin no carga el childNodes[1] y childNodes[2], y en m si carga el childNodes[0] ?????

Gracias por atender mi llamado

:crap:

Por centinela218

56 de clabLevel



 

msie
Citar            
MensajeEscrito el 20 Feb 2005 07:10 am
jeje Disculpen la idiotes Pero ya vi el error en el archivo xml.

el error es que no cierrto correctamente la etiqueta <carpeta>, la tenia asi

<carpeta>imagenes\<carpeta>

y es de la siguiente manera:

<carpeta>imagenes\<\carpeta>

Gracias por la atencion de todos modos

Por centinela218

56 de clabLevel



 

msie
Citar            
MensajeEscrito el 20 Feb 2005 07:32 am
<carpeta>imagenes<\carpeta>

Por La100rra

Claber

5776 de clabLevel

11 tutoriales
4 articulos

Genero:Masculino  

Cd. Juárez, Chihuahua, México.

clabbrowser
Citar            
MensajeEscrito el 23 Feb 2005 02:46 pm
si abres el xml con mozilla y tienes algún error de ese tipo te lo dice.

Por SeRPiko

6 de clabLevel



 

mozilla
Citar            
MensajeEscrito el 23 Feb 2005 03:20 pm
<carpeta>imagenes</carperta>

si le pones un cargador


Código :

obj_xml.onLoad = function(cargo) {
if (cargo) {
   carga = obj_xml.getBytesLoaded();
   total = obj_xml.getBytesTotal();
   porcentaje = (carga*100/total)
   if(porcentaje==100){
      m = obj_xml.firstChild.childNodes[0].firstChild.nodeValue;
      ini = obj_xml.firstChild.childNodes[1].firstChild.nodeValue;
      fin = obj_xml.firstChild.childNodes[2].firstChild.nodeValue;
      n="s"+ini+".jpg";
      p.contentPath = m+n;
      t.text="s"+ini;
      trace(m+ " "+ ini+" " + fin)
   }
} else {
      trace("Error");
}
}

mas referencia busca en los tutoriales aqui o presion F1 en flash

Saludos :D

Por flasher

Invitado



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.