Hy!
How do I create an array with actionscript if I’m not Using attributes in my XML file.
<?xml version="1.0" encoding="iso-8859-1"?>
<portfolio>
<books name="Livros">
<image>
<title>O Livro de Mistério</title>
<thumb>photos/livros/livromisterioth.jpg</thumb>
<source>photos/livros/livromisterio.jpg</source>
<gsource>photos/livros/livromisteriog.jpg</gsource>
<text>Desenhado para a história o Livro de Mistério</text>
<who>As histórias são escritas pela Fátima e pelo Luís Matias</who>
<when>Entre 2005 e 2006 mas o Livro só é</when>
</image>
<image>
<title>Um Boneco</title>
<thumb>photos/livros/bonecoth.jpg</thumb>
<source>photos/livros/boneco.jpg</source>
<gsource>photos/livros/bonecog.jpg</gsource>
<text>Este Boneco enfeita alguma página do livro</text>
<who>Este desenho foi feito para um livro escrito pela</who>
<when>O Livro só é publicado em 2007 pela Pé de Página Editores</when>
</image>
<image>
<title>Estante</title>
<thumb>photos/livros/estanteth.jpg</thumb>
<source>photos/livros/estante.jpg</source>
<gsource>photos/livros/estanteg.jpg</gsource>
<text>Desenhado para a história o Livro de Mistério.</text>
<who>Este desenho foi feito para um livro escrito pela</who>
<when>O Livro só é publicado em 2007 pela Pé de Página Editores</when>
</image>
</books>
</portfolio>
This is what I would use to create some Array of attributes:
var nArray = new Array();
for (var i = 0; i<gallery_xml.firstChild.childNodes[0].childNodes.length; i++) {
nArray.push(gallery_xml.firstChild.childNodes[0].childNodes*.attributes.title);
}
But how do I extract all the <title> info into the nArray from the XML file above? Anyone?
Thanx, Marc06