Ir para conteúdo

POWERED BY:

Arquivado

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

Diogo LG

Galeria Flash + XML

Recommended Posts

Boa Tarde Amigo,

 

Eu tenho uma Galeria em flash que lê um XML onde consta o "titulo" da foto e "descrição" da foto,

esse "titulo" e "descrição", eles não estão mostrando os caracteres especiais tais como: (^,~,ç) entre outros,

 

Segue codigos:

 

Flash:

1º Action Frame

var filename_list = new Array();

var url_list = new Array();

var url_target_list:Array = new Array();

var title_list = new Array();

var description_list = new Array();

var filepath:String = "thumbnails/";

 

var flashmo_xml = new XML();

flashmo_xml.ignoreWhite = true;

flashmo_xml.onLoad = function()

{

var nodes:Array = this.firstChild.childNodes;

for(var i=0;i<nodes.length;i++)

{

filename_list.push(nodes.attributes.filename);

url_list.push(nodes.attributes.url);

url_target_list.push(nodes.attributes.target);

title_list.push(nodes.attributes.title);

description_list.push(nodes.attributes.description);

}

}

flashmo_xml.load("flashmo_092_product_list.xml");

 

2º Action Frame

this.onEnterFrame = function()

{

if( flashmo_xml.loaded )

play();

else

gotoAndStop(2);

}

 

3º Action Frame

tn_group.tn._visible = false;

tn_group.setMask( tn_group_area );

var total:Number = filename_list.length;

var distance_y:Number = tn_group.tn._height + 5;

var current:Number = 0;

var i:Number = 0;

 

for( ; i < total; i++ )

{

tn_group.tn.duplicateMovieClip("tn"+i, i);

tn_group["tn"+i].preloader._width = 0;

tn_group["tn"+i].tn_button._visible = false;

tn_group["tn"+i].txt = (i+1);

tn_group["tn"+i].tn_no = i;

tn_group["tn"+i]._y = i * distance_y;

 

tn_group["tn"+i].fm_title.text = title_list;

tn_group["tn"+i].description.text = description_list;

tn_group["tn"+i].tn_button.onRelease = function()

{

getURL( url_list[this._parent.tn_no], url_target_list[this._parent.tn_no] );

}

}

var total:Number;

var i:Number = 0;

var p:Number = 0;

var scrolling_speed:Number = 0.20; // 0.00 to 1.00

var cv:Number = 0;

var cv_old:Number = 0;

var onDrag:Boolean;

tn_group_area._visible = false;

scroller();

 

function scroller():Void

{

scroller_mc._y = scrollable_area_mc._y;

tn_group._y = tn_group_area._y;

sr = tn_group_area._height/tn_group._height;

scroller_mc._height = scrollable_area_mc._height * sr;

sd = scrollable_area_mc._height - scroller_mc._height;

cd = tn_group._height - tn_group_area._height;

cr = cd / sd;

 

if( tn_group._height <= tn_group_area._height )

{

scroller_mc._visible = scrollable_area_mc._visible = false;

}

else

{

scroller_mc._visible = scrollable_area_mc._visible = true;

}

scroller_mc.onPress = function()

{

this.startDrag(false, this._x, scrollable_area_mc._y, this._x,

scrollable_area_mc._y + scrollable_area_mc._height - this._height + 2);

onDrag = true;

this.onEnterFrame = function()

{

new_y = tn_group_area._y + scrollable_area_mc._y*cr - this._y*cr;

cv = (new_y - tn_group._y) * scrolling_speed;

tn_group._y += cv;

if( onDrag == false && cv_old == cv )

delete this.onEnterFrame;

cv_old = cv;

}

}

scroller_mc.onRelease = scroller_mc.onReleaseOutside = function()

{

this.stopDrag();

onDrag = false;

}

}

 

4º Action Frame

stop();

tn_group["tn"+current].tn_pic.loadMovie( filepath + filename_list[current] );

tn_group["tn"+current].tn_pic._alpha = 0;

onEnterFrame = function()

{

filesize_total = tn_group["tn"+current].tn_pic.getBytesTotal();

 

if( filesize_total == 0 ) filesize_total = 1;

percent = Math.round( tn_group["tn"+current].tn_pic.getBytesLoaded() / filesize_total * 100 );

tn_group["tn"+current].txt = "loading...\n" + percent + "%";

tn_group["tn"+current].preloader._width = percent;

 

if( percent == 100 )

{

tn_group["tn"+current].txt = "";

tn_group["tn"+current].preloader._visible = false;

tn_group["tn"+current].tn_button._visible = true;

tn_group["tn"+current].tn_pic._alpha += 10;

}

if( tn_group["tn"+current].tn_pic._alpha > 100 )

{

nextFrame();

delete this.onEnterFrame;

}

}

 

5º Action Frame

if( current < total - 1 )

{

current++;

prevFrame();

}

else

{

nextFrame();

}

 

6º Action Frame

stop();

 

 

Segue Codigo XML:

<?xml version="1.0" encoding="UTF-8"?>

<thumbnails>

<thumbnail filename="obra 01.jpg" url="construcao.html" target="_blank"

title="Construção Civil"

description="Construção em Geral"/>

<thumbnail filename="obra 02.jpg" url="pintura.html" target="_blank"

title="Pintura Industrial"

description="aplicação de Elastômero Securit 2" />

<thumbnail filename="obra 03.jpg" url="porcelanato.html" target="_blank"

title="Construção Civil"

description="Aplicação de Porcelanato e Serviços em Geral" />

<thumbnail filename="obra 04.jpg" url="reforma.html" target="_blank"

title="Construção Civil"

description="Reforma e Serviços de acabamento" />

</thumbnails>

 

Sou novato nisso e estou usando um modelo pronto para aprender a editar e vê como as coisas funcionam, mais nisso eu tive muita dificuldade, como esse caracteres especiais podem aparecer? oq devo fazer?

 

Me ajudem por favor.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Aconteceu algo semelhante comigo... criei o xml no dreamweaver... utf8... mas os caracteres especiais nao funcionavam nem a pau!

Abri o xml no bloco de notas, salvou e funfou <_<

Compartilhar este post


Link para o post
Compartilhar em outros sites

Experimente 'embedar' a fonte para Latin. Selecione as 4 opções.

 

Abs

 

 

Isso no Flash?

ou no xml?

 

Aconteceu algo semelhante comigo... criei o xml no dreamweaver... utf8... mas os caracteres especiais nao funcionavam nem a pau!

Abri o xml no bloco de notas, salvou e funfou <_<

 

Boa Tarde Amigo, como você fez?

 

você abriu o xml em bloco de nota e salvou como txt mais com extenção XML? EX: Galeria.xml (fazendo pelo loco de notas)

e isso funcionou legal?

 

VLW

Compartilhar este post


Link para o post
Compartilhar em outros sites

Experimente 'embedar' a fonte para Latin. Selecione as 4 opções.

 

Abs

 

 

Muito Obrigado amigo você resolveu meu problema,

 

Foi simples e rápido agora com sua explicação,

 

Para ajudar outras pessoas que tiveram o mesmo problema que o meu,

 

é simples, abra seu .FLA, vá ate onde vai ficar o titulo e descrição da foto (selecione o local, va em properties>na aba CHARACTER> procure o nome Anti-Alias: clique na seta da caixa> selecione o nome: Anti-Alias for readability> na caixa que se abrirá escola Embed... e na proxima caixa procure e escolha a opção Latin I (388 glyphs) !!

 

pronto só salva e execultar e seus Caracteres estarão lá

 

Vlw Amigo pela sua ajuda !!

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.