Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Éber Freitas Dias

Problemas com XML (undefined)

Recommended Posts

Fala galera...Seguinte... to quebrando a cabeça aqui mas cansei... olhem meu XML:

<?xml version="1.0" encoding="iso-8859-1"?><news>	<newsentry id="0">		<img>"news/teste.jpg"</img>		<titulo>Este é um Texte</titulo>		<texto>Lorem ipsum dolor sit amet.</texto>	</newsentry></news>

Eis meu ActionScript:

stop();function NewsDock(xml_file) {	var newsImg = xml_file.firstChild.childNodes[0].childNodes[0].nodeValue;	var newsTitle = newsImg.nextSibling.nodeValue;	var newsText = newsTitle.nextSibling.nodeValue;		mc_news.txt_imagem.loadMovie(newsImg);	mc_news.txt_titulo.text = newsTitle;	mc_news.txt_texto.text = newsText;}var news_xml = new XML();news_xml.onLoad = function(success) {	if (success) NewsDock(this);	else trace("ERRO");}news_xml.load("news.xml");

O problema é que onde deveria ser carregado as informações no stage, está aparecendo o texto "undefined".O QUE EU FAÇO? Já não sei mais o que fazer... Valeu pela ajuda!

Compartilhar este post


Link para o post
Compartilhar em outros sites
function NewsDock(xml_file) {	var xmlNode:XMLNode = xml_file.firstChild.childNodes[0];	var newsImg = xmlNode.childNodes[0].nodeValue;	var newsTitle = xmlNode.childNodes[1].nodeValue;	var newsText = xmlNode.childNodes[2].nodeValue;	mc_news.txt_imagem.loadMovie(newsImg);	mc_news.txt_titulo.text = newsTitle;	mc_news.txt_texto.text = newsText;}

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.