Estou com um probleminha, tenho um slideshow que recebe imagens, e textos atravéz de um XML, mas ele não está interpretando caracteres especiais. Tentei codificalos tipo "á", mas ainda assim não são reconhecidos. alguém sabe o que eu poderia fazer?
Código AS 2
CÓDIGO
// XML Image Slide
// Created by Burhan Uddin
// Date: 10/11/2007
// Version.: 1.0
// (c) http://dscripts.awardspace.com
// URL to the source xml
var xml_src = 'photo_slider.xml';
// Seconds to show each slide
var slide_delay = 10;
// Frame rate of this flash file
var frame_rate = 25;
// Sliding. Set to 1 to start auto sliding, to turn it off set 0
var sliding = 1;
// amount of fading speed 1-100
var fade = 30;
var sec_count = 0;
p = 0;
b = 0;
function loadXML(loaded)
{
if (loaded)
{
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++)
{
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
titulo[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
}
showImage();
}
else
{
content = "Failed to load XML File";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(xml_src);
listen = new Object();
listen.onKeyDown = function()
{
if (Key.getCode() == Key.LEFT)
{
if(picture._alpha >= 100)
prevImage();
}
else if (Key.getCode() == Key.RIGHT)
{
if(picture._alpha >= 100)
nextImage();
}
}
Key.addListener(listen);
PREV.onRelease = function()
{
if(picture._alpha >= 100)
prevImage();
}
NEXT.onRelease = function()
{
if(picture._alpha >= 100)
nextImage();
};
function reset_timer()
{
sec_count = 0;
this.timer.gotoAndPlay(1);
this.slider.gotoAndPlay(1);
}
function showImage()
{
if (loaded == filesize)
{
picture._alpha = 0;
picture.loadMovie(image[p], 1);
this.titulo.txt = titulo[p];
this.cap.txt = description[p];
hover.pic.txt = p+1+" / "+total;
this.hover.play();
reset_timer();
}
}
function nextImage()
{
if (p<total-1)
p++;
else
p = 0;
showImage();
}
function prevImage()
{
if(p>0)
p--;
else
p = total-1;
showImage();
}
this.onEnterFrame = function()
{
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
if (loaded != filesize)
{
preloader.bar._xscale = 100*loaded/filesize;
if (preloader._alpha<100)
preloader._alpha += fade;
if(cap._alpha > 0)
cap._alpha += fade;
}
else
{
if (picture._alpha<100)
picture._alpha += fade;
if(preloader._alpha > 0)
preloader._alpha -= fade;
if( picture._alpha >= 100 )
{
if(b == 0)
{
picture_bg.loadMovie(image[p], 1);
b = 1;
}
}
else
b = 0;
}
}
// Created by Burhan Uddin
// Date: 10/11/2007
// Version.: 1.0
// (c) http://dscripts.awardspace.com
// URL to the source xml
var xml_src = 'photo_slider.xml';
// Seconds to show each slide
var slide_delay = 10;
// Frame rate of this flash file
var frame_rate = 25;
// Sliding. Set to 1 to start auto sliding, to turn it off set 0
var sliding = 1;
// amount of fading speed 1-100
var fade = 30;
var sec_count = 0;
p = 0;
b = 0;
function loadXML(loaded)
{
if (loaded)
{
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++)
{
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
titulo[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
}
showImage();
}
else
{
content = "Failed to load XML File";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(xml_src);
listen = new Object();
listen.onKeyDown = function()
{
if (Key.getCode() == Key.LEFT)
{
if(picture._alpha >= 100)
prevImage();
}
else if (Key.getCode() == Key.RIGHT)
{
if(picture._alpha >= 100)
nextImage();
}
}
Key.addListener(listen);
PREV.onRelease = function()
{
if(picture._alpha >= 100)
prevImage();
}
NEXT.onRelease = function()
{
if(picture._alpha >= 100)
nextImage();
};
function reset_timer()
{
sec_count = 0;
this.timer.gotoAndPlay(1);
this.slider.gotoAndPlay(1);
}
function showImage()
{
if (loaded == filesize)
{
picture._alpha = 0;
picture.loadMovie(image[p], 1);
this.titulo.txt = titulo[p];
this.cap.txt = description[p];
hover.pic.txt = p+1+" / "+total;
this.hover.play();
reset_timer();
}
}
function nextImage()
{
if (p<total-1)
p++;
else
p = 0;
showImage();
}
function prevImage()
{
if(p>0)
p--;
else
p = total-1;
showImage();
}
this.onEnterFrame = function()
{
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
if (loaded != filesize)
{
preloader.bar._xscale = 100*loaded/filesize;
if (preloader._alpha<100)
preloader._alpha += fade;
if(cap._alpha > 0)
cap._alpha += fade;
}
else
{
if (picture._alpha<100)
picture._alpha += fade;
if(preloader._alpha > 0)
preloader._alpha -= fade;
if( picture._alpha >= 100 )
{
if(b == 0)
{
picture_bg.loadMovie(image[p], 1);
b = 1;
}
}
else
b = 0;
}
}
Esse é o XML:
CÓDIGO
<?xml version="1.0" encoding="UTF-8" charset="iso-8859-1" standalone="yes"?>
<images>
<pic>
<image>album/batmanark.png</image>
<titulo>Batman Arkham Asylum</titulo>
<caption>é Encarnando o Homem-Morcego, enfrente o Coringa e outros vilões no sanatório de Gotham City.</caption>
</pic>
</images>
<images>
<pic>
<image>album/batmanark.png</image>
<titulo>Batman Arkham Asylum</titulo>
<caption>é Encarnando o Homem-Morcego, enfrente o Coringa e outros vilões no sanatório de Gotham City.</caption>
</pic>
</images>

Help














