Ir para conteúdo

POWERED BY:

Arquivado

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

Rodrigo Hensel

Galeria XML+FLASH

Recommended Posts

Olá pessoal!

Estou criando uma galeria de fotos no Flash usando XML, consegui carregar a foto, a legenda, porém não consigo carregar o link.

Gostaria que a foto que estou carregando tivesse o respectivo link ou que só enviasse este link via getURL.

Alguém pode me dar uma força? Segue o código pra darem uma olhada.

Desde já agradeço.

 

 

System.useCodepage = true;
var arquivo:XML = new XML();
arquivo.load("destaque.xml");
arquivo.ignoreWhite = true;
arquivo.onLoad = function() {
	photo.foto01.img01.loadMovie(this.childNodes[0].childNodes[0].attributes.imagem);
	photo.foto02.img02.loadMovie(this.childNodes[0].childNodes[1].attributes.imagem);
	photo.foto03.img03.loadMovie(this.childNodes[0].childNodes[2].attributes.imagem);
	photo.foto04.img04.loadMovie(this.childNodes[0].childNodes[3].attributes.imagem);
	photo.foto05.img05.loadMovie(this.childNodes[0].childNodes[4].attributes.imagem);
	photo.foto06.img06.loadMovie(this.childNodes[0].childNodes[5].attributes.imagem);
	photo.foto07.img07.loadMovie(this.childNodes[0].childNodes[6].attributes.imagem);
	photo.foto08.img08.loadMovie(this.childNodes[0].childNodes[7].attributes.imagem);
	photo.foto09.img09.loadMovie(this.childNodes[0].childNodes[8].attributes.imagem);
	photo.foto10.img10.loadMovie(this.childNodes[0].childNodes[9].attributes.imagem);
	
	photo.foto01.legenda1_mc.text = this.childNodes[0].childNodes[0].attributes.legenda;
	photo.foto02.legenda2_mc.text = this.childNodes[0].childNodes[1].attributes.legenda;
	photo.foto03.legenda3_mc.text = this.childNodes[0].childNodes[2].attributes.legenda;
	photo.foto04.legenda4_mc.text = this.childNodes[0].childNodes[3].attributes.legenda;
	photo.foto05.legenda5_mc.text = this.childNodes[0].childNodes[4].attributes.legenda;
	photo.foto06.legenda6_mc.text = this.childNodes[0].childNodes[5].attributes.legenda;
	photo.foto07.legenda7_mc.text = this.childNodes[0].childNodes[6].attributes.legenda;
	photo.foto08.legenda8_mc.text = this.childNodes[0].childNodes[7].attributes.legenda;
	photo.foto09.legenda9_mc.text = this.childNodes[0].childNodes[8].attributes.legenda;
	photo.foto10.legenda10_mc.text = this.childNodes[0].childNodes[9].attributes.legenda;
	
	end.text = this.childNodes[0].childNodes[0].attributes.link;
};
_root.photo.foto01.link_mc.onRelease = function() {
	getURL(end.text);
};

 

XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<destaque>
<foto imagem="03_3.jpg" legenda="Nome01" link="http://www.terra.com.br"/>
<foto imagem="03_2.jpg" legenda="Nome02" link="http://www.terra.com.br"/>
<foto imagem="03_1.jpg" legenda="Nome03" link="http://www.terra.com.br"/>
<foto imagem="03_4.jpg" legenda="Nome04" link="http://www.terra.com.br"/>
<foto imagem="02_4.jpg" legenda="Nome05" link="http://www.terra.com.br"/>
<foto imagem="02_3.jpg" legenda="Nome06" link="http://www.terra.com.br"/>
<foto imagem="02_2.jpg" legenda="Nome07" link="http://www.terra.com.br"/>
<foto imagem="02_1.jpg" legenda="Nome08" link="http://www.terra.com.br"/>
<foto imagem="01_4.jpg" legenda="Nome09" link="http://www.terra.com.br"/>
<foto imagem="01_3.jpg" legenda="Nome10" link="http://www.terra.com.br"/>
</destaque>

Compartilhar este post


Link para o post
Compartilhar em outros sites

o código esta certo, você já verificou se na caixa de texto end esta aparecendo o link corretamente?

 

 

pode ser problema de escopo, essa caixa de texto esta no _root? se estiver testa assim:

 

 

_root.photo.foto01.link_mc.onRelease = function() {
	getURL(_root.end.text);
};

 

[]´s

Compartilhar este post


Link para o post
Compartilhar em outros sites

o código esta certo, você já verificou se na caixa de texto end esta aparecendo o link corretamente?

 

 

pode ser problema de escopo, essa caixa de texto esta no _root? se estiver testa assim:

 

 

_root.photo.foto01.link_mc.onRelease = function() {
	getURL(_root.end.text);
};

 

[]´s

 

Exibir em uma caixa de texto eu consigo sim, tanto que a variável "legenda" faz isso, cada uma em um campo de texto.

O que preciso na verdade é pegar a variável "link" e envia-la via getURL ou fazer com que ela se torne o link de sua respectiva imagem.

Compartilhar este post


Link para o post
Compartilhar em outros sites

testa assim então

 

 

arquivo.onLoad = function() {
   _root.photo.foto01.link_mc.link = this.childNodes[0].childNodes[0].attributes.link;
   _root.photo.foto01.link_mc.onRelease = function() {
		  getURL(this.link);  
	} 
};

 

[]´s

Compartilhar este post


Link para o post
Compartilhar em outros sites

É isso mesmo Eder, agora funcionou. Vlw cara.

 

 

 

testa assim então

 

 

arquivo.onLoad = function() {
   _root.photo.foto01.link_mc.link = this.childNodes[0].childNodes[0].attributes.link;
   _root.photo.foto01.link_mc.onRelease = function() {
		  getURL(this.link);  
	} 
};

 

[]´s

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.