Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Boas pessoal,
Estou com um stress no flash para puxar um documento xml que se encontra on-line noutro servidor.
o xml esta aqui: XML
e no codigo tenho isto:
stop();
//aqui faz o preload
preloadbar_mc.onEnterFrame = function(){
if (!this.target) return (0);
var loaded = target.getBytesLoaded();
var total = target.getBytesTotal();
var scale = 0;
if (loaded && total){
var percent = loaded/total;
scale = 100 * percent;
}
this._xscale = scale;
}
//testei com os traces para ver se puxava conteudos
preloadbar_mc.target = my_xml;
var my_xml = new XML();
my_xml.onLoad = function(success){
if (success){
//trace(this);
//trace(this.nextSibling);
trace(this.parentNode.childNodes[1]);
gotoAndPlay(2);
}
}
my_xml.load("http://www.mynetpress.com/xml/FINUPE/internet.asp");
//trace(my_xml);
for( var n=0;n<this.firstChild.childNodes.length;n++) {
guid.value = this.firstChild.childNodes.childNodes[0].nodeValue;
titulo.value = this.firstChild.childNodes.childNodes[1].nodeValue;
publicacao.value = this.firstChild.childNodes.childNodes[2].nodeValue;
datas.value = this.firstChild.childNodes.childNodes[3].nodeValue;
pagina.value = this.firstChild.childNodes.childNodes[4].nodeValue;
begin.value = this.firstChild.childNodes.childNodes[5].nodeValue;
texto.value = this.firstChild.childNodes.childNodes[6].nodeValue;
pdf.value = this.firstChild.childNodes.childNodes[7].nodeValue;
}
Como podem ver, depois de carregar o xml eu testei com os traces, só o trace(this); é que puxa os conteudos mas do <channel> ate </channel> e eu quero os childNodes de <item> até </item>
Alguem sabe o que está mal feito ?
estou bloqueado!
Obrigado
Carregando comentários...